• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The server encountered an internal error (No input attribute for mapping path /login)

 
selvi family
Ranch Hand
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
these are my struts application files.

JSP - LoginView.jsp
Action - LoginAction.java
Form - LoginForm.java
Bean- LoginBean.java

When I submits the LoginView.jsp
I got the following error
The server encountered an internal error (No input attribute for mapping path /login) that prevented it from fulfilling this request.

so I placed input="/LoginView.jsp" is struts-config.xml in Action mapping definition.
<!-- Action Mapping Definitions -->
<action-mappings>
<action name="loginForm" path="/login" type="myTest.struts.LoginAction" scope="request" validate="true" input="/LoginView.jsp">

<forward name="valid" path="/Success.jsp" />
<forward name="invalid" path="/Failure.jsp" />
</action>
</action-mappings>


Now page gets submitted but same LoginView.jsp is getting dispalyed.
My Action is not called.No validation happened..

pls help me to resolve this...
 
Cendy Nguvy
Ranch Hand
Posts: 37
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Is there any "validate" method in LoginForm ?

If you code validate="true", Struts call method LoginForm.validate(...).

Cendy
 
Cendy Nguvy
Ranch Hand
Posts: 37
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this :

LoginForm.java



LoginAction.java



I think it's working.

Cendy
[ June 30, 2005: Message edited by: cendy nguvy ]
 
Rashmini Palakurti
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think Cendy's answer is right but it would be better if u extend ValidatorForm instead of ActionForm.

It is returning to LoginView.jsp bcoz there was some error in processing ur Input.Put some log statements in LoginForm's validate() method , i think that would be helpful..
 
selvi family
Ranch Hand
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks to both of u
will try and get back to u...

regards
selvi
 
alan do
Ranch Hand
Posts: 354
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it's probably a case of simple path reference error. path="/login" is equivalent of action="/appContextRoot/login.do". just make sure you have the application's context root as a part of your html:form action attribute value, eg. action="/app/login", not just action="/login".
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic