• Post Reply Bookmark Topic Watch Topic
  • New Topic

Generating HTML from Java Code

 
Somesh Rathi
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
My problem is related to embedding the HTML code in Java

I want to display the textfield populated with the existing string variable using out.print();

I'm using the following code




If I use the above code , it displayt the textfeild with text " Somesh "
whereasI want it should display the textfield with Text " Somesh's Rathi"

Actually , it is truncating all the characters that comes after ' ( single quote) from the firstname while displaying.

Here I want it should display the firstname both with the '(Sinle Quote) & space in the textfield

I think its the problem with delimeter but not able to find the solution.

Waiting for yourmuch needed & favorable reply.
Many Thanks in advance!!!

Regards,
Somesh





[BSouther: Added UBB CODE tags and added a meaningful subject line.]
[ August 10, 2007: Message edited by: Ben Souther ]
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not an advanced question. Moving...

(You may want to give this topic a meaningful subject too, otherwise people may overlook it)
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Somesh Rathi
Welcome to JavaRanch!

In an effort to help you get the most from our forums, we've compiled a
list of tips for asking questions here. You can find the list in our
FAQ section here.
In particular please see:
UseAMeaningfulSubjectLine
and
EaseUp to find out why addint "urgent" to your subject line or post can actually slow down or halt responses to your question altogether.

Again, welcome to JavaRanch and good luck with your question.
-Ben
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a great example of why you should avoid generating HTML from Java code and forward to a JSP page instead.

It was very difficult to read your code and there were several mistakes in it.
I'm assuming that you didn't copy and paste the actual code into Javaranch because what's there wouldn't compile. I fixed only what was needed to make it compile and ran it so I could see what the actual output was and I got this:


Ignoring the space around the equals sign in the type='text" pair and the lack of space in between 'text' and name, can you see the problem here?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!