Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Struts2.2.3 problem  RSS feed

 
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.



 
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
 
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.
 
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"

 
There are 10 kinds of people in this world. Those that understand binary get this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!