Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts error

 
jone wiilum
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i develope a simple login form in struts.
when i run from weblogic i get error

<Error> <HTTP> <BEA-101017> <[ServletContext(id=12055248,name=MyProject,context-path=/MyProject)] Root cause of ServletException.
javax.servlet.jsp.JspException: Cannot retrieve mapping for action /login
at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:810)
at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:506)
at jsp_servlet.__login._jspService(__login.java:181)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:446)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
>

where my struts-config.xml file is
<struts-config>
<data-sources />

<form-beans>
<form-bean name="loginForm" type="my.LoginForm"></form-bean>
</form-beans>

<global-exceptions />
<global-forwards />

<action-mappings>
<action
path ="/userLoginAction"
type="my.LoginAction"
name="loginForm"
input="/login.jsp">
<forward name="logSuccess" path="/login.jsp"/>
<forward name="home1" path="/home.jsp"/>
</action>
</action-mappings>

<message-resources parameter="my.ApplicationResources" />

</struts-config>

how i can solve this problem?
 
amit-walia
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If error says that mapping "/login " could not found it means it is not declared in your xml file.
Your action tag should say something like this.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65105
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please take the time to choose the correct forum for your posts. This forum is for questions on HTML and Javascript.

This post has been moved to a more appropriate forum.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65105
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"amit-walia",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
JavaRanch Sheriff
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic