It's not a secret anymore!*
The moose likes Servlets and the fly likes How to join two or three String together? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to join two or three String together?" Watch "How to join two or three String together?" New topic
Author

How to join two or three String together?

whongwei
Greenhorn

Joined: Dec 12, 2000
Posts: 7
Hi, All:
Can any tell me how to do this in JSP? Thanks for the help.
I have three string:
String A="Happy";
String B="Birthday";
String C="To";
String D="You!";
How do I get the String Message="Happy Birthday To You!", I know it is very simple when you know it, right?
Thank you.
Hongwei
Somas kanthan
Greenhorn

Joined: Nov 16, 2000
Posts: 8
<% out.println(A + " " + B + " " + C + " " + D) %>
whongwei
Greenhorn

Joined: Dec 12, 2000
Posts: 7
Hi kanthan:
Thanks for the reply. Yes, this way
<% out.println(A + " " + B + " " + C + " " + D) %>
can get the Happy Bithday To You!
But want I want is <%=Message%> will the the same result.
Because I need to pass this String Message to my servlet.
How to do that? Thanks.
Hongwei
Somas kanthan
Greenhorn

Joined: Nov 16, 2000
Posts: 8
<body>
<%!
String A="Happy";
String B="Birthday";
String C="To";
String D="You!";
%>
<%! String Message = (A + " " + B + " " + C + " " + D); %>
<cnter> Hi, <br>
<%= Message %>
</center>
</body>

Hope this will do for you.
Thanks
whongwei
Greenhorn

Joined: Dec 12, 2000
Posts: 7
Hi kanthan:
Thanks, thanks, thanks, It works. Thanks again.
Hongwei
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to join two or three String together?
 
Similar Threads
where are all the hot mama's
Jim...
:o Map and Matthew :o - Birthday babies
field-validator type="date" works fine but got ognl.MethodFailedException
Happy Birthday Sriraj Rajaram