tags:

views:

88

answers:

2

Hi All,

Thinking that , in struts 1.2, say a funtion public ActionForward abc(){ return null;} will return to the same page. But i got this exception. java.lang.NullPointerException org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:441) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) javax.servlet.http.HttpServlet.service(HttpServlet.java:710) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:738)

How to get into the same page? Please help!! Thanks

+1  A: 

In struts-config.xml, write a forward tag inside your action tag like this.

<action ...>
<forward name = "samePage" path="..."/>
</action>

Now, in your code use

mapping.findForward("samePage");
RaviG
Thank you!!.. I did it.
Manoj
A: 

You can use

return mapping.getInputForward();

karthikn_jay