Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
JSP - A mailing list about Java Server Pages specification and reference
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
- Problem with ajax4jsf resources with WebSphere v6.1.

- Problem with ajax4jsf resources with WebSphere v6.1.

2007-07-16       - By titou09

 Back
When testing the hibernate2 sample of seam 2.0 beta, on was v6.1.0.9, the
ajax4jsf resources URI are not routed to the aja4jsf filter.
Aja4jsf adds the following line in the pages with aja4jsf tags (ie pages book
.xhtml, main.xhml, register.xhtml):

 |  <script type="text/javascript" src="/<my context root>/a4j.res/org
.ajax4jsf.framework.ajax.AjaxScript"></script>
 |

But this resource (it returns the javascript that holds the A4J function) is
never processed ("A4J" is not defined in firefox error console) by WAS due to 2
problems :

First problem:
It seems that on was v6.1.0.9, a request is routed to a filter only if a
servlet-mapping is defined for the URL. In my web.xml file, I have the
following for filters and servlets:

 |   <filter>
 |       <filter-name>Seam Filter</filter-name>
 |       <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
 |    </filter>
 |    <filter-mapping>
 |       <filter-name>Seam Filter</filter-name>
 |       <url-pattern>/*</url-pattern>
 |    </filter-mapping>
 |   <servlet>
 |       <servlet-name>Faces Servlet</servlet-name>
 |       <servlet-class>javax.faces.webapp.FacesServlet Source code of javax.faces.webapp.FacesServlet</servlet-class>
 |       <load-on-startup>1</load-on-startup>
 |    </servlet>
 |    <servlet>
 |       <servlet-name>Seam Resource Servlet</servlet-name>
 |       <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet
-class>
 |       <load-on-startup>2</load-on-startup>
 |    </servlet>
 |    <servlet-mapping>
 |       <servlet-name>Faces Servlet</servlet-name>
 |       <url-pattern>*.seam</url-pattern>
 |    </servlet-mapping>
 |    <servlet-mapping>
 |       <servlet-name>Seam Resource Servlet</servlet-name>
 |       <url-pattern>/seam/resource/*</url-pattern>
 |    </servlet-mapping>
 |

It seems that even if the URI match the pattern for the filter, the filter
never sees this request because (IMO), there is no servlet with a matchng
pattern

Adding the following lines in web.xml makes the "/a4j.res/org.ajax4jsf
.framework.ajax.AjaxScript"  to be processed by the seam filter

 |    <servlet-mapping>
 |       <servlet-name>Seam Resource Servlet</servlet-name>
 |       <url-pattern>/a4j.res/*</url-pattern>
 |    </servlet-mapping>
 |
I will ask the IBM support and eventually open a PMR for this.

But even with this, the browser never receives the ajax4jsf javascript related
to the "/a4j.res/org.ajax4jsf.framework.ajax.AjaxScript" URI.

Second problem:
In the org.jboss.seam.servlet.SeamFilter.java at line 66, "bf.getUrlPattern()"
for the ajax4jsf filter returns "*.seam"

So as the requested resource ("/a4j.res/org.ajax4jsf.framework.ajax.AjaxScript"
) does not match the pattern, it is not processed by the ajax4jsf filter.
In org.jboss.seam.servlet.SeamFilter.java, adding the line "bf.setUrlPattern
(null);"  in line 66 as follow, makes it work:

 |    if (filter instanceof AbstractFilter) {
 |       AbstractFilter bf = (AbstractFilter) filter;
 |
 |       log.debug(" pattern=" + bf.getUrlPattern());    ---> display "*.seam"
 |       bf.setUrlPattern(null);                         ---> ugly hack
 |
 |       if (bf.isMappedToCurrentRequestPath(request)) {
 |          filter.doFilter(request, response, this);
 |       } else {
 |          this.doFilter(request, response);
 |       }
 |    } else {
 |       filter.doFilter(request, response, this);
 |    }
 |

Is this second problem a WebSphere problem? is it a configuration problem? is
it a bug in seam?


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic
&p=4064800#4064800

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode
=reply&p=4064800
__ ____ ____ ____ ____ ____ ____ ____ ____ ____
jboss-user mailing list
jboss-user@(protected)
https://lists.jboss.org/mailman/listinfo/jboss-user

©2008 junlu.com - Jax Systems, LLC, U.S.A.