Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

But this code, throws the exception "The Struts dispatcher cannot be found".

 
Gerenne Vives
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I've got the following problem, I must load index.jsp page, when the user is validated, but before I should to obtain some lists in specific action, if I do:

<package name="app" namespace="/" extends="app-default">
<result-types>
<result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult" />
</result-types>
<action name="login" class="com.app.action.LoginAction">
<result name="success" type="tiles">welcome</result>
<result name="errorLogin">login.jsp</result>
</action>
</package>

It's work fine, but in this case the lists can't be populated, I try to do a redirect:

<package name="app" namespace="/" extends="app-default">
<result-types>
<result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult" />
</result-types>
<action name="login" class="com.app.action.LoginAction">
<result name="success" type="redirect-action">
<param name="actionName">./ini.action</param>
<param name="parse">true</param>
</result>
</action>
<action name="ini" class="com.app.action.TableAction" method="obtainTable">
<result name="success" type="tiles">welcome</result>
<result name="errorLogin">login.jsp</result>
</action>
</package>

But this code, throws the exception "The Struts dispatcher cannot be found".

Can you help me?, Thanks in advance!
 
Gerenne Vives
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I've found the problem instead of to use redirect:

<action name="login" class="com.app.action.LoginAction">

<result name="errorLogin">login.jsp</result>
<result name="success" type="chain">appFind</result>
</action>
<action name="appFinf" class="com.app.action.TableAction" method="obtainTable">
<result name="success" type="tiles">welcome</result>
</action>


Thanks!!!
 
Mohana Rao Sv
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this.
 
yem oliv
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mohana Rao Sv wrote:Try this.


yep, works.
thanks
 
Gerenne Vives
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I found the problem!!

The problem was is the library, I need only this libraries:

commons-fileupload-1.2.2
commons-io-2.0.1
commons-lang-2.5
commons-logging-1.1.1
commons-logging-api-1.1
freemarker-2.3.18
javassist-3.11.0.GA
ognl-3.0.4
struts2-core-2.3.1.2
xwork-core-2.3.1.2

Now, It's work, thanks for all!!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic