You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dirk Behrendt <sc...@web.de> on 2003/08/06 13:42:38 UTC
How to realize forward to the same page?
Hello!
I want, that the user can switch the language from a drop down menu at
runtime. When he chose a language, an action class is called and sets
the locale.
I want, that there is no forward to another page. The current page
should be maintained. When I do it without the <forward> tag, an empty
page came as a result. But I want the same page.
example:
The user switches the language
before switch after switch
/login.jsp --> /login.jsp
/someJSP.jsp --> /someJSP.jsp
What I have to add to the struts-config.xml?
Dirk
struts-config.xml
-----------------
<action path="/language"
type="sample.LanguageAction"
name="languageForm"
scope="request">
</action>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
AW: How to realize forward to the same page?
Posted by Dirk Behrendt <sc...@web.de>.
...I have tried this and now I get an internal server error
Do I have to add something to my struts-config.xml??
java.lang.NullPointerException
at
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestPr
ocessor.java:441)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
279)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
-----Ursprüngliche Nachricht-----
Von: Yansheng Lin [mailto:yansheng.lin@isogis.com]
Gesendet: Mittwoch, 6. August 2003 17:46
An: 'Struts Users Mailing List'
Betreff: RE: How to realize forward to the same page?
return new ActionForward(mapping.getInput()); will return you to where
you came
from.
-----Original Message-----
From: schnoerk@web.de [mailto:schnoerk@web.de]
Sent: August 6, 2003 5:43 AM
To: struts-user@jakarta.apache.org
Subject: How to realize forward to the same page?
Hello!
I want, that the user can switch the language from a drop down menu at
runtime. When he chose a language, an action class is called and sets
the locale.
I want, that there is no forward to another page. The current page
should be maintained. When I do it without the <forward> tag, an empty
page came as a result. But I want the same page.
example:
The user switches the language
before switch after switch
/login.jsp --> /login.jsp
/someJSP.jsp --> /someJSP.jsp
What I have to add to the struts-config.xml?
Dirk
struts-config.xml
-----------------
<action path="/language"
type="sample.LanguageAction"
name="languageForm"
scope="request">
</action>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: How to realize forward to the same page?
Posted by Yansheng Lin <ya...@isogis.com>.
return new ActionForward(mapping.getInput()); will return you to where you came
from.
-----Original Message-----
From: schnoerk@web.de [mailto:schnoerk@web.de]
Sent: August 6, 2003 5:43 AM
To: struts-user@jakarta.apache.org
Subject: How to realize forward to the same page?
Hello!
I want, that the user can switch the language from a drop down menu at
runtime. When he chose a language, an action class is called and sets
the locale.
I want, that there is no forward to another page. The current page
should be maintained. When I do it without the <forward> tag, an empty
page came as a result. But I want the same page.
example:
The user switches the language
before switch after switch
/login.jsp --> /login.jsp
/someJSP.jsp --> /someJSP.jsp
What I have to add to the struts-config.xml?
Dirk
struts-config.xml
-----------------
<action path="/language"
type="sample.LanguageAction"
name="languageForm"
scope="request">
</action>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org