On zaterdag, mei 24, 2003, at 05:01 Europe/Amsterdam, Jason Carreira wrote:
If you map a JSP page using the "dispatcher" result, this should work, right? Or am I missing something?
I tried to do this, because this seems the logical thing to do (just as in WW1). However nothing happens. Could someone tell me if there are any errors in my xwork.xml?
<!DOCTYPE xwork PUBLIC "-//OpenSymphony Group//XWork 1.0//EN" "http://www.opensymphony.com/xwork/xwork-1.0.dtd">
<xwork>
<package name="default" >
<result-types>
<result-type name="dispatcher" class="com.opensymphony.webwork.dispatcher.ServletDispatcherResult"/>
<result-type name="redirect" class="com.opensymphony.webwork.dispatcher.ServletRedirectResult"/>
<result-type name="velocity" class="com.opensymphony.webwork.dispatcher.VelocityResult"/>
<result-type name="chain" class="com.opensymphony.xwork.ActionChainResult"/>
</result-types>
<interceptors>
<interceptor name="timer" class="com.opensymphony.xwork.interceptor.TimerInterceptor"/>
<interceptor name="logger" class="com.opensymphony.xwork.interceptor.LoggingInterceptor"/>
<interceptor name="chain" class="com.opensymphony.xwork.interceptor.ChainingInterceptor"/>
<interceptor name="static-params" class="com.opensymphony.xwork.interceptor.StaticParametersInterceptor"/ >
<interceptor name="params" class="com.opensymphony.xwork.interceptor.ParametersInterceptor"/>
<interceptor name="component" class="com.opensymphony.xwork.interceptor.component.ComponentInterceptor "/>
<interceptor name="token" class="com.opensymphony.webwork.interceptor.TokenInterceptor"/>
<interceptor name="token-session" class="com.opensymphony.webwork.interceptor.TokenSessionStoreInterceptor "/>
<interceptor-stack name="defaultStack">
<interceptor-ref name="timer"/>
<interceptor-ref name="logger"/>
<interceptor-ref name="component"/>
<!-- <interceptor-ref name="static-params"/> -->
<interceptor-ref name="static-params"/>
<interceptor-ref name="params"/>
</interceptor-stack>
</interceptors>
<action name="login" class="nl.smashbits.hmmblog.action.LoginAction">
<result name="success" type="dispatcher">
<param name="location">/login.jsp</param>
</result>
<interceptor-ref name="defaultStack"/>
</action>
</package>
</xwork>
(I placed login.jsp in the root of my .war; the jsp can be executed when I go to the URL directly.)
The 'funny' thing is that when I have my action executed from a simple WW form, the action result is processed. Is this difference intentional? (Which would mean that what I want is not possible?)
You can also add a global-result for "login" and have an interceptor that checks your login stuff and returns "login" without executing the rest of the action, and it will always go to that JSP.
I will look into this. Seems quite elegant to take someone to the login page when he wants to execute an action that requires login. (This is possible when using JAAS and form based login, btw.)
Hendrik
Jason
-----Original Message----- From: Hendrik van der Linde [mailto:[EMAIL PROTECTED] Sent: Friday, May 23, 2003 2:50 PM To: [EMAIL PROTECTED] Subject: [OS-webwork] WW2: include based on action result
Hi,
In webwork 1 it is possible to include a JSP page in another by setting the result of an action to a particular JSP. This way you could program in a condition in your action. For example display a page with a login form, if the user is not logged in, and a logout page if she is. How can this be done in webwork 2, without coding the condition into the jsp page (using if's)? Ultimately I want to use an interceptor to code the condition, and thus short-circuit the action. For example:
[begin main page]
<ww:action name="user_messages" />
[/end main page]
Is this possible; what do you think?
Regards, Hendrik
------------------------------------------------------- This SF.net email is sponsored by: ObjectStore. If flattening out C++ or Java code to make your application fit in a relational database is painful, don't do it! Check out ObjectStore. Now part of Progress Software.http://www.objectstore.net/sourceforge _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
------------------------------------------------------- This SF.net email is sponsored by: ObjectStore. If flattening out C++ or Java code to make your application fit in a relational database is painful, don't do it! Check out ObjectStore. Now part of Progress Software. http://www.objectstore.net/sourceforge _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
------------------------------------------------------- This SF.net email is sponsored by: ObjectStore. If flattening out C++ or Java code to make your application fit in a relational database is painful, don't do it! Check out ObjectStore. Now part of Progress Software. http://www.objectstore.net/sourceforge _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork