This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Struts2.2.3 problem  RSS feed

 
francis varkey
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using struts-2.2.3 . I have two jsps and one action.

1) login.jsp
<s:form id="loginForm" name="loginForm" action="/General/LoginManagementAction" method="post">
</s:form>
2) success.jsp

3) com.test.general.action.LoginManagementAction.java (Action class)

4) struts.xml

<struts>
<package name="General" extends="struts-default" namespace="/General">
<action name="LoginManagementAction" class="com.test.general.action.LoginManagementAction">
<result name="success">/pages/test/success.jsp</result>
</action>
</package>
</struts>

5) web.xml

<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>

<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<welcome-file-list>
<welcome-file>/pages/general/login.jsp</welcome-file>
</welcome-file-list>


Now I am getting following warning

Jun 15, 2011 9:37:21 AM com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
WARNING: No configuration found for the specified action: '/General/LoginManagementAction' in namespace: '//pages/general'. Form action defaulting to 'action' attribute's literal value.
Jun 15, 2011 9:37:21 AM com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn
WARNING: No configuration found for the specified action: '/General/LoginManagementAction' in namespace: '//pages/general'. Form action defaulting to 'action' attribute's literal value.



 
Papier Jungo
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The "general" in the welcome file list sould prolly start with upper case
 
Orton K Randy
Ranch Hand
Posts: 41
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You've been here too long not to learn coding your snippets. Ok, I'd like to see your folder structure, particularly that of struts.xml. Does it reside in the classpath of your webapp? See here for more details.
 
Jesus Mireles
Ranch Hand
Posts: 122
IntelliJ IDE Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your problem is how you defined your form.

Instead of using action="/General/LoginManagementAction"

Set two attributes

action="LoginManagementAction"
namespace="/General"

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!