This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cookies and Struts

 
Achal Jalan
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

My application starts of with an index.jsp page where the user inputs his name and email address, this call an action 'createCookie' where the details are stored in a cookie.

I need the details to be read from the cookie and displayed to the user the next time he opens the webpage.

The relevant code int index.jsp



The revelant code in createCookie.java





The code in bold italics in index.jsp in the text input box is where I am getting the error. If any one could point me the right way to do this, it will be great.

The error I get is "attribute nameCookie has no value", even though the line above that prints out the value of the nameCookie.


Thanks a bunch
Achal
[ February 28, 2005: Message edited by: Achal Jalan ]
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the JSP Code, simply remove the "value" attribute. In a Struts <html:text> tag, the value comes from the property attribute, and the value attribute generally does not need to be specified.

Merrill
 
Bhaskar Reddy
Ranch Hand
Posts: 52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In the above scenario, if we want to display the cookie value in a text-box (instead of read-only label), how do we display the same?

The below code doesnt display it in the text-box, even though until the previous line, the cookie value is coming... can someone point out my mistake?


I think Merrill said something about
...the value comes from the property attribute..

Does that mean the cookie name & the text-box name must be same??

My jsp code is -


Thank you,
Bhaskar
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic