[JBoss Seam] - Re: Searchengine friendly links
by spambob
Now I don't understand it too - a classic case of 'I don't see the forest cause of all the trees'. Thanks for your clarification & patience!
EDIT: i just saw normans post while editing mine - so i post my solution, feel free to integrate / modify it:
The filterclass:
public class UrlRewriteFilter implements Filter {
|
| private FilterConfig filterConfig;
| private String[] variableNames;
| private String[] delimiters;
| private String targetUrl;
|
| public void init(FilterConfig filterConfig) throws ServletException {
| this.filterConfig = filterConfig;
| this.targetUrl = filterConfig.getInitParameter("target");
| String pattern = "#\\{[^}]+}";
| String configString = filterConfig.getInitParameter("pattern");
| Pattern p = Pattern.compile(pattern);
| Matcher m = p.matcher(configString);
|
| List<String> variableNames = new ArrayList<String>();
| while(m.find()) {
| variableNames.add(configString.substring(m.start()+2, m.end()-1));
| }
| this.variableNames = variableNames.toArray(new String[variableNames.size()]);
| this.delimiters = configString.split(pattern);
| }
|
| public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
| HttpServletRequest httpRequest = (HttpServletRequest) servletRequest;
| String request = httpRequest.getRequestURI();
|
| int start;
| int end = request.indexOf(delimiters[0]);
| for(int i=0; i<variableNames.length; i++) {
|
| start = end + delimiters[ i ].length();
| end = request.indexOf(delimiters[i+1], start);
| servletRequest.setAttribute(variableNames, request.substring(start, end));
| }
| filterConfig.getServletContext().getRequestDispatcher(targetUrl).forward(servletRequest, servletResponse);
| }
|
| public void destroy() {;
|
| }
The config in web.xml:
<filter>
| <filter-name>UrlRewriteFilter</filter-name>
| <filter-class>com.example.UrlRewriteFilter</filter-class>
| <init-param>
| <param-name>pattern</param-name>
| <param-value>/products/#{categoryId}/#{productId}.xhtml</param-value>
| </init-param>
| <init-param>
| <param-name>target</param-name>
| <param-value>/showProduct.xhtml</param-value>
| </init-param>
| </filter>
|
| <filter-mapping>
| <filter-name>UrlRewriteFilter</filter-name>
| <url-pattern>/products/*</url-pattern>
| </filter-mapping>
The bean that loads the product is the one above and the jsf is trivial.
With a configuration like this a URL like http://www.example.com/products/cars/123.xhtml is mapped to http://www.example.com/showProducts.xhtml?categoryId=cars&productId=123 Note that the request variables are attributes not parameteres therefore @RequestParameter doesn't work.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3988547#3988547
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3988547
19Â years, 5Â months
[JBoss Portal] - Re: general question
by thomas.heuteï¼ jboss.com
"ahmed maaloul" wrote : Hello, I am a new JBoss Portal user, For that, I am tryin to know more about these product. So Here are my question:
You should read the documentation and product sheet to get an idea about the product
1-Does JBoss Portal offers 2 type of pages open windows and contecnt page?
I don't understand the question
2-Can we design(custom) the graphic chart of the portal?
Yes you can create your own theme and layout and deploy theme dynamically and independently of the portal code
3-Can we define and visualize the organigram of the Portal users?
You can see the users and their roles
4-Does JBoss Portal offers the webmail funtionnality?
You can find portlets for that
5-Does JBoss Portal offers a page which contains the portal plan?
I don't understand the question
6-Are Netscape Navigator 4.7 compatible with JBoss Portal fuctionnalities?
It depends basically on the theme you made (see question 2)
7-Does JBoss Portal offers accesibility facilites for handicaped persons?
We don't support Section 508 yet if that's what you meant.
8-Does JBoss Portal manage content archieving?
The CMS has an export feature, all the content is also versionned
9-Does JBoss Portal offers a workflow engine to design business process?
You will never design business processes within portal. You will be able to add business process at different level within portal in the future. (Soon within the CMS)
10- What's the business process related to the publication of content?
I don't understand the question
11-Does JBoss Portal offers statistics related to the use and traffic of the portal (intranet/extranet)?
We started integration with JBoss ON to detect failures of the portal.
12-Can we made a thematic folder?
I don't understand the question
13-Does JBoss Portal offers the fuction on the media release?
I don't know what "media release" is
14-Does JBoss Portal offers the fuction on thenews letter?
this is the responsability of a portlet
15-Does JBoss Portal offers the fuction on anounces?
this is the responsability of a portlet
16-Does JBoss Portal offers the fuction on the sondage?
this is the responsability of a portlet
17-Does JBoss Portal offers the fuction on the calendar?
this is the responsability of a portlet
18-Does JBoss Portal offers the fuction on the agednda?
this is the responsability of a portlet
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3988546#3988546
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3988546
19Â years, 5Â months
[Installation, Configuration & Deployment] - JEMS Installer 1.2.0.CR1: Errors when starting JBoss
by Juergen.Zimmermann
I installed JEMS 1.2.0.CR1. There was no problem.
However, when I try to start JBoss I get the following error messages. Any hint is appreciated...
| 16:23:42,873 INFO [TomcatDeployer] deploy, ctxPath=/web-console, warUrl=.../deploy/management/console-mgr.sar/web-console.war/
| 16:23:43,634 INFO [[/web-console]] MonitorsFolder: Failed to init plugin, null
| 16:23:43,644 INFO [[/web-console]] UCLs: Failed to init plugin, null
| 16:23:43,664 INFO [[/web-console]] JMS Message: Failed to init plugin, null
| 16:23:43,664 INFO [[/web-console]] JSR77 WebModule: Failed to init plugin, null
| 16:23:43,724 INFO [[/web-console]] J2EEFolder: Failed to init plugin, null
| 16:23:43,754 INFO [[/web-console]] AOPFolder: Failed to init plugin, null
| 16:23:43,754 INFO [[/web-console]] SystemFolder: Failed to init plugin, null
| 16:23:43,804 INFO [[/web-console]] MBeans: Failed to init plugin, null
| 16:23:43,814 INFO [[/web-console]] JSR77 Domains and Servers: Failed to init plugin, null
| 16:23:43,814 INFO [[/web-console]] JSR77 EJBModules and EJBs: Failed to init plugin, null
| 16:23:43,824 INFO [[/web-console]] JSR77 J2EE Apps: Failed to init plugin, null
| 16:23:47,870 INFO [MailService] Mail Service bound to java:/Mail
| ...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3988540#3988540
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3988540
19Â years, 5Â months
[JBoss Seam] - Theme / Locale / TZ not persistent
by wsollers
The cookies emitted when the user selects one of the ui customization selectors expire when the browser is closed. That means that when the user logs back into the app in another session the preferences are lost.
The problem is this code in the XXXSelector
public void select()
{
Contexts.removeFromAllContexts( Seam.getComponentName(Theme.class) );
FacesContext facesContext = FacesContext.getCurrentInstance();
String viewId = facesContext.getViewRoot().getViewId();
UIViewRoot viewRoot = facesContext.getApplication().getViewHandler().createView(facesContext, viewId);
facesContext.setViewRoot(viewRoot);
if (cookieEnabled)
{
HttpServletResponse response = (HttpServletResponse) facesContext.getExternalContext().getResponse();
response.addCookie( new Cookie("org.jboss.seam.core.Theme", theme) );
}
}
I modded it to :
public void select()
{
Contexts.removeFromAllContexts( Seam.getComponentName(Theme.class) );
FacesContext facesContext = FacesContext.getCurrentInstance();
String viewId = facesContext.getViewRoot().getViewId();
UIViewRoot viewRoot = facesContext.getApplication().getViewHandler().createView(facesContext, viewId);
facesContext.setViewRoot(viewRoot);
if (cookieEnabled)
{
HttpServletResponse response = (HttpServletResponse) facesContext.getExternalContext().getResponse();
Cookie cookie = new Cookie("org.jboss.seam.core.Theme", theme);
cookie.setMaxAge ( 31536000 );
response.addCookie( cookie );
}
}
Now when I go into a new session the cookie is picked up and used and all my settings are okay.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3988539#3988539
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3988539
19Â years, 5Â months