• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts2.2.3 problem

 
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Mac IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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"

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic