voyent
Clicking back/events giving a NullPointerException  XML
Forum Index -> Portals & Portlets
Author Message
xchander

Joined: 07/Aug/2007 00:00:00
Messages: 9
Offline


Hi ,
I am using weblogic 9.2, Icefaces 1.6 and jsf1.1 .

I am stuck at a point, when after login , I try to click on any link, it gives me a NullPointerExcpetion at
com.icesoft.faces.context.DOMResponseWriter.enhanceAndFixDocument(DOMResponseWriter.java:298)

com.icesoft.faces.context.DOMResponseWriter.endDocument(...
..
.

.
..
.
Even If you refresh (press F5) the page, the same error comes.
When you try to view the HTML Source of the page, it gives you the html of login page.


This is simple command link :

Code:
<h:commandLink id="homelink" action="gotest" >
   <h:outputText value="Home" />
 </h:commandLink>


My web.xml is ..........

Code:
 <?xml version="1.0"?>
 
 <!DOCTYPE web-app PUBLIC
   "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
   "http://java.sun.com/dtd/web-app_2_3.dtd">
 
 <web-app>
     <display-name>mu Application</display-name>
  
 
 	<!-- JavaServer Faces -->
     <context-param>
         <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
         <param-value>server</param-value>
     </context-param>
 
     <context-param>
     	<param-name>javax.faces.CONFIG_FILES</param-name>
     	<param-value>/WEB-INF/faces-config.xml</param-value>
     </context-param>
 
     
     <filter>
         <filter-name>SecurityFilter</filter-name>
         <filter-class>mypetstore.view.util.SecurityFilter</filter-class>
     </filter>
     
     <filter-mapping>
         <filter-name>SecurityFilter</filter-name>
         <url-pattern>*.jsf</url-pattern>
     </filter-mapping>   
 
     <listener>
         <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
     </listener>
  
     <!-- Faces Servlet -->
     <servlet>
         <servlet-name>Faces Servlet</servlet-name>
         <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
         <load-on-startup>1</load-on-startup>
     </servlet>
     
         
     <servlet>
 	  <servlet-name>SpringContextServlet</servlet-name>
 	  <servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class>	  
 	  <load-on-startup>1</load-on-startup>
     </servlet>
 	
     <!-- Faces Servlet Mapping -->
     <servlet-mapping>
         <servlet-name>Faces Servlet</servlet-name>
         <url-pattern>*.jsf</url-pattern>
     </servlet-mapping>
 <servlet>
         <servlet-name>Persistent Faces Servlet</servlet-name>
         <servlet-class>com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet</servlet-class>
         <load-on-startup> 1 </load-on-startup>
     </servlet>
 
     <servlet>
         <servlet-name>Blocking Servlet</servlet-name>
         <servlet-class>com.icesoft.faces.webapp.xmlhttp.BlockingServlet</servlet-class>
         <load-on-startup> 1 </load-on-startup>
     </servlet>
 
     <!-- extension mapping -->
     <servlet-mapping>
         <servlet-name>Faces Servlet</servlet-name>
         <url-pattern>*.jsf</url-pattern>
     </servlet-mapping>
 
     <servlet-mapping>
         <servlet-name>Persistent Faces Servlet</servlet-name>
         <url-pattern>*.jsf</url-pattern>
     </servlet-mapping>
 
     <servlet-mapping>
         <servlet-name>Persistent Faces Servlet</servlet-name>
         <url-pattern>*.iface</url-pattern>
     </servlet-mapping>
 
     <servlet-mapping>
         <servlet-name>Persistent Faces Servlet</servlet-name>
         <url-pattern>/xmlhttp/*</url-pattern>
     </servlet-mapping>
 
     <servlet-mapping>
         <servlet-name>Blocking Servlet</servlet-name>
         <url-pattern>/block/*</url-pattern>
     </servlet-mapping>
 
     <session-config>
       <session-timeout>1</session-timeout>
     </session-config>
     
     <!-- Welcome files -->
     <welcome-file-list>
         <welcome-file>index.jsf</welcome-file>
         <welcome-file>index.jsp</welcome-file>
         <welcome-file>index.html</welcome-file>
     </welcome-file-list>
 
 </web-app>
 
 


.............

My faces-config.xml file is :

Code:
<?xml version='1.0' encoding='UTF-8'?>
 
 
 <!DOCTYPE faces-config PUBLIC
   "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
   "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
 
 
 <faces-config>
     <application>
         <locale-config>
             <default-locale>en</default-locale>
         </locale-config>
                 
     </application>
 
     <navigation-rule>
         <from-view-id>*</from-view-id>
         <navigation-case>
             <from-outcome>gotest</from-outcome>
             <to-view-id>/test.iface</to-view-id>
             <redirect/>
         </navigation-case>
     </navigation-rule>
 
      
 
     <navigation-rule>
         <from-view-id>/login.iface</from-view-id>
         <navigation-case>
             <from-outcome>success</from-outcome>
             <to-view-id>/home.iface</to-view-id>
         </navigation-case>
     </navigation-rule>
 
     
   
 </faces-config>



Seems I am missing something in configuration

Pls help.

thanks








xchander

Joined: 07/Aug/2007 00:00:00
Messages: 9
Offline


In faces-config.xml , giving the <redirect/> in the navaigation-rules doen't give the Nullpointerexception and all seems to be fine.

Code:
 <navigation-rule>
          <from-view-id>/login.iface</from-view-id>
          <navigation-case>
              <from-outcome>success</from-outcome>
              <to-view-id>/home.iface</to-view-id>
 [b]<redirect />[/b]
          </navigation-case>
      </navigation-rule>


But why to give redirect if such cases when your navigation result is not purely redirect ?

Can anybody explain ...what I am missing here ?

phuong.nguyen

Joined: 23/Oct/2007 00:00:00
Messages: 9
Offline


Try to remove the redirect and modify the navagation rule:
<navigation-rule>
<from-view-id>*</from-view-id>
<navigation-case>
<from-outcome>gotest</from-outcome>
<to-view-id>/test.iface</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>

by replacing the * with the specific view-id

Would you receive the same error?
mark.collette


Joined: 07/Feb/2005 00:00:00
Messages: 1692
Offline


Actually, try just remove the <from-view-id> tags completely.

Also, I notice that you're mapping "*.jsf" to both the Faces Servlet and the Persistent Faces Servlet. Usually people map different extensions to each one, such as ".iface" to the Persistent Faces Servlet, and ".faces" to the Faces Servlet.
[Email]
xchander

Joined: 07/Aug/2007 00:00:00
Messages: 9
Offline


Hi,

The faces-config file is correct, its typo mistake in writing this question. sorry for that.

I tried removing the <from- view-id> all together, but its giving me the same problem.

One thing I noticed is that, after login, it comes to the home.jsp, where the link for test.jsp is there.

But if i do the View source of this page, it still shows the html code for login page.

Any idea why ? Is Specifying .iface in navigation is correct.... I tried with .jsp too but that also failed giving same problem

And why clicking on Back button of browser throws the NullPointerExecption ?









 
Forum Index -> Portals & Portlets
Go to:   
Powered by JForum 2.1.7ice © JForum Team