• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Problem with login page

 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You mean to say i should write the loggedIn.jsp
as this
 
Varun Nayudu
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please any body have any sugestions.....I am unable to display username.... with the above code
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you put the user name into the request scope?
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic