• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with login page

 
Varun Nayudu
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You mean to say i should write the loggedIn.jsp
as this
 
Varun Nayudu
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please any body have any sugestions.....I am unable to display username.... with the above code
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you put the user name into the request scope?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic