aspose file tools*
The moose likes Struts and the fly likes Problem with login page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem with login page" Watch "Problem with login page" New topic
Author

Problem with login page

Varun Nayudu
Ranch Hand

Joined: Jun 26, 2006
Posts: 159
I am trying to made small login applicatio in which the user enters the username and passsword and on submitting the page a username is displayed....


Here is the code for it

web.xml


struts-config.xml


login.jsp


loggedIn.jsp


formBean


Error Page


SCJP 1.5, SCWCD 1.5
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

The error message is telling you precisely what's wrong: the <html:param> tag is not valid outside of the tags listed in the error message. Also, your bean tag usage is missing the actual tag name; it just has the prefix.

If you're using Struts 1.3, which it appears you are, your struts-config.xml file should contain the 1.3 DTD--you're using the DTD from 1.1. (It might still work, but is confusing and misleading.)

If you're using any recent app server you no longer need to specify tag libraries in the web.xml and should avoid doing do. Your web.xml should contain an appropriate DTD/XSD. Also, if you're using a recent app server you shouldn't need the EL tags, as JSP EL is provided by the container itself.

In any case, if the attribute you're trying to display is in request scope and you're using a JSP 2+ container, just use plain old JSP EL to display the attribute: ${requestScope.userName}.
Varun Nayudu
Ranch Hand

Joined: Jun 26, 2006
Posts: 159
David Newton wrote:The error message is telling you precisely what's wrong: the <html:param> tag is not valid outside of the tags listed in the error message. Also, your bean tag usage is missing the actual tag name; it just has the prefix.



Thanks for your reply but can you please specify which tag should i nest the <html:param > with Since i am new to struts please if you can provide me with the tag name

regards

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

The stack trace wrote:
javax.servlet.ServletException: LinkParam tag must be nested in a Link, Rewrite, or Frame tag

Again--if you're just trying to display a scoped attribute use JSP EL.
Varun Nayudu
Ranch Hand

Joined: Jun 26, 2006
Posts: 159
You mean to say i should write the loggedIn.jsp
as this
Varun Nayudu
Ranch Hand

Joined: Jun 26, 2006
Posts: 159
Please any body have any sugestions.....I am unable to display username.... with the above code
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Did you put the user name into the request scope?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Problem with login page