Meaningless Drivel is fun!
The moose likes JSP and the fly likes Jsp - Syntax Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Jsp - Syntax" Watch "Jsp - Syntax" New topic

Jsp - Syntax

naro pad
Ranch Hand

Joined: May 07, 2008
Posts: 58

I have a text box and I want the value of that text box to be an expression.
I try this but it doesn't work.

<input type="text" name="customer_name" value="<%= tmp.getCustomerName() %>"/>

What is the right syntax?Can anyone help me with at...

Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3381

Yes, the syntax seems to be correct only. What exactly do you get?

Are you sure that the "customerName" property is set with some non-null, non-empty values? Just check that out.

Do you get any errors, if not?

Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Originally posted by panayiotis panayiotou:
I try this but it doesn't work.

On an internet forum, "it doesn't work" is, for the most part, a useless statement. It would be better if you told us what did happen when you tried to run it.

Did the page blow up?
If so what error messages were dumped to the screen.
If none, did you look in the server's logs to see what might have gone wrong? If so, can you post the stack trace so we can see it?
Did the expression return "null" or an empty string?

Without this type of information, folks here can't do much to help you.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: Jsp - Syntax
It's not a secret anymore!