• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 196
  • Last Modified:

String variables in HTML/JSP

Hello,
Is is possiblt to have a variable in a HTML/JSP tag instead of a hard coded value.

For example (This is a Servlet snippet)

out.println ("<p><font size=\"3\" color=\"red\"> <b> Hello <br /> </font></b> </p>"  );

Is there a way for me to make the ' Hello' into a variable? so I could change and display the message
according to my requirement?



0
prain
Asked:
prain
  • 2
1 Solution
 
radarshCommented:
Hi prain,

I don't know if you are looking after such a simple solution!

<html>
<body>
<%
    String msg = "Hello";
%>
<p><font size="3" color="red"><b><%=msg%><br/></font></b></p>
</body>
</html>

________
radarsh
0
 
prainAuthor Commented:
radarsh,

Opps. Thanks radarsh. Sorry, you have to excuse me for asking that question. You know sometimes licensed drivers also do mistakes. :-) . To say the truth, I am totally new to this HTML/JSP business and about 2 weeks ago only I started serious programming on these. So until I get a good handle on the wheel, I would do traffic violations.

Thanks any ways for all your help, including the previous answers. That helps me a lot.
Crusing well and learning well.

Thanks
prain.
0
 
radarshCommented:
prain,

Good Luck in your adventure! :)

________
radarsh
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now