• 1 reply
  • Latest Post - ‏2011-11-14T20:51:56Z by seohulu
1 Post

Pinned topic Issue with Struts 2 interceptor

‏2011-11-11T15:29:58Z |
I am creating a small Struts 2 project. If I enable the interceptor, the values are not getting passed from JSP to Action. Attached the code.

<?xml version="1.0" encoding="utf-8"?>
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<constant name="struts.devMode" value="true" />
<include file="struts-default.xml" />
<package name="practice" extends="struts-default">
<interceptor name="logger1" class="com.home.practice.LoggerInterceptor" />
<interceptor name="before" class="com.home.practice.PreViewInterceptor" />
<interceptor name="after" class="com.home.practice.PostViewInterceptor" />
<interceptor-stack name="myStack">
<interceptor-ref name="logger1" />
<!-- <interceptor-ref name="before"/> <interceptor-ref name="after"/> -->
<action name="loginCancel">
<action name="login" class="com.home.practice.LoginAction">
<!-- <interceptor-ref name="myStack" />
--> <result name="input">/Login.jsp</result>
<result name="error">/Login.jsp</result>
<result name="cancel" type="redirect">/Login.jsp</result>
<action name="userinfo" class="com.home.practice.UserInfoAction">
<result name="summary">/Welcome.jsp</result>

Updated on 2011-11-14T20:51:56Z at 2011-11-14T20:51:56Z by seohulu
  • seohulu
    6 Posts

    Re: Issue with Struts 2 interceptor

    1)that value is passed from jsp to Action is default behavior of struts2, as long as the getter and setter has been setup correctly in your LoginAction.

    2)"<include file="struts-default.xml" />" are not needed, because you already have extends="struts-default".

    3) check your logs , like localhost.log, there might be more info about what is going wrong.
    good luck
    Acoolme is an Online Marketing Software Platform And Social Community