This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Struts and the fly likes The server encountered an internal error (No input attribute for mapping path /login) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "The server encountered an internal error (No input attribute for mapping path /login)" Watch "The server encountered an internal error (No input attribute for mapping path /login)" New topic
Author

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

selvi family
Ranch Hand

Joined: Nov 26, 2004
Posts: 39
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

Joined: May 25, 2005
Posts: 37
Hi,

Is there any "validate" method in LoginForm ?

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

Cendy
Cendy Nguvy
Ranch Hand

Joined: May 25, 2005
Posts: 37
Try this :

LoginForm.java



LoginAction.java



I think it's working.

Cendy
[ June 30, 2005: Message edited by: cendy nguvy ]
Rashmini Palakurti
Greenhorn

Joined: Jun 29, 2005
Posts: 13
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

Joined: Nov 26, 2004
Posts: 39
Hi,

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

regards
selvi
alan do
Ranch Hand

Joined: Apr 14, 2005
Posts: 354
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".


-/a<br />certified slacker...yes, my last name is 'do' - <a href="http://www.luckycouple.com" target="_blank" rel="nofollow">luckycouple.com</a>
 
GeeCON Prague 2014
 
subject: The server encountered an internal error (No input attribute for mapping path /login)