jQuery in Action, 3rd edition
The moose likes Struts and the fly likes Struts2.0 interceptor Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2.0 interceptor Problem" Watch "Struts2.0 interceptor Problem" New topic

Struts2.0 interceptor Problem

anil kumar mullapudi

Joined: Oct 25, 2011
Posts: 8
i am unable to populate modeldriven bean from jsp form in struts2.0 Action class.In Action class the bean is giving empty values.if i remove the interceptors from stuts.xml, then i am able to get values in Action class from jsp.But i need to use interceptors and also need data from my form using model driven concept. I am struggling to find the root cause.

I integrated struts , spring and hibernate.

my struts.xml

<package name="default" namespace="/" extends="struts-default">
<result-type name="tiles"
class="org.apache.struts2.views.tiles.TilesResult" />

<interceptor name="authenticator" class="com.sample.interceptors.MyLoggingInterceptor"/>
<interceptor-stack name="prime-stack">
<interceptor-ref name="authenticator"/>
<interceptor-ref name="defaultStack"/>

<default-interceptor-ref name="defaultStack"/>

<action name="signin" class="loginAction" method="login">
<interceptor-ref name="authenticator"/>
<result name="success" type="tiles">login_success</result>
<result name="fail" type="tiles">errors</result>
<result name="input" type="tiles">login</result>

my applicationContext.xml

<bean id="loginAction" class="com.sample.actions.LoginAction" scope="prototype">
<property name="objUserLoginService" ref="loginserviceref"/>

<bean id="loginserviceref" class="com.sample.services.UserLoginService">
<property name="objUserLoginDao" ref="logindaoref"></property>

<bean id="logindaoref" class="com.sample.daos.UserLoginDao">
<property name="sessionFactory" ref="mySessionFactory"/>

my Action Class

public class LoginAction extends ActionSupport implements ModelDriven{

private User objUser = new User();

public Object getModel() {
return objUser;

public String login() {

try {

System.out.println("username-->" + objUser.getStrUser_Name()); // I am unable to get my login form data from login.jsp while
// using interceptors
System.out.println("password-->" + objUser.getStrUser_Password()); // I am unable to get my login form data from login.jsp
} catch(Exception e) {
return "success";

Rob Spoor

Joined: Oct 27, 2005
Posts: 20276

Welcome to the Ranch!

We have a separate forum for Struts questions, so I'll move this thread to it.

How To Ask Questions How To Answer Questions
I agree. Here's the link: http://aspose.com/file-tools
subject: Struts2.0 interceptor Problem
It's not a secret anymore!