This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Struts and the fly likes How to set a html:text value equal to an expression? (SOLVED) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to set a html:text value equal to an expression? (SOLVED)" Watch "How to set a html:text value equal to an expression? (SOLVED)" New topic
Author

How to set a html:text value equal to an expression? (SOLVED)

Matt Kohanek
Village Idiot
Ranch Hand

Joined: Apr 04, 2009
Posts: 483

I am trying to do something like this:



but that gives me an error about expecting quotation marks I think it was.

Then I found something online that I thought was the answer, so I tried:



But I get an error saying an equal sign is expected.

I just want to put the ServletContext attribute into this text box. I seem to remember doing this in the past, but with jsf using faces-config and #{} or something like that. Is there a way to do what I am trying to do, and how so?



edit - amazingly I found the answer by just trying different combinations that I thought could work lol



True wisdom is in knowing you know nothing - Socrates
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60080
    
  65

Please be sure to ask Struts questions in the Struts forum. I have moved this post there for you.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

The real solution is to properly initialize the action form, though.
Matt Kohanek
Village Idiot
Ranch Hand

Joined: Apr 04, 2009
Posts: 483

Can you elaborate please?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Initialize the action form with the value from the application context.
Matt Kohanek
Village Idiot
Ranch Hand

Joined: Apr 04, 2009
Posts: 483

I am not familiar with what you mean, i will have to do some studying. Thanks for the advice
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

(Or at the very least use EL, or the EL tags in a pre-JSP 2.0 container.)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to set a html:text value equal to an expression? (SOLVED)
 
Similar Threads
Need an attribute to be available in different places (SOLVED)
How to Configure SSL over Database in Spring?
Not getting the validation message in my example.
Attempted a bean operation on a null object
Advice on a putting dynamic message on jsp page depending on action taken by user