File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes how to get full string values in the form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "how to get full string values in the form" Watch "how to get full string values in the form" New topic
Author

how to get full string values in the form

ravi san
Greenhorn

Joined: Jul 27, 2012
Posts: 5
dbEXDIR = rs.getString("EXECUTIVE_DIRECTOR").trim();
//out.print("<BR> test "+dbEXDIR);
out.print("<TR>");
out.print("<TD ALIGN=LEFT JUSTIFIED><b>"+dbEXDIR+"</b></TD>");

temp = "GetMIPS1.jsp?formEXDIR="+dbEXDIR;
out.print("<td align=center>");
out.print("<DIV onMouseover=\"ddrivetip('Click for SHIFT1 info.', '#D9FFFF')\" onMouseout='hideddrivetip()'><b><a href="+temp+"><img border=0 src='SHIFT1.GIF'></a></div>");
out.print("</td>");

When I //out.print("<BR> test "+dbEXDIR); using above code dbEXDIR values are like
test ADIL BELIHOMJI
test ADOLFO REYES
test ALDO P REY
But in the temp values for GetMIPS1.jsp?formEXDIR="+dbEXDIR getting truncated. that is only ADIL or ADOLFO or ALDO are displaying. Can anyone suggest me why this is getting truncated

Thank you

Sri
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61105
    
  66

Why are you doing out.print() of static HTML in a JSP? :confused:


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
ravi san
Greenhorn

Joined: Jul 27, 2012
Posts: 5
Its not HTML. Its jsp code

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

No, that is not JSP code. It's Java code. Unless possibly it's Java code which was taken from a scriptlet... but I can't imagine why anybody would write to the response from inside a scriptlet. That's a really strange way to entirely miss the point of JSP.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61105
    
  66

ravi san wrote:Its not HTML. Its jsp code

No it's not. In this statement:
you are emitting static HTML inside a out.print() statement. The question is: why? It's completely backwards. The whole point of a JSP, as Paul pointed out, is to be able to use static HTML as template text.

You'll encounter fewer problems by doing things in the intended and best practice ways.
 
jQuery in Action, 2nd edition
 
subject: how to get full string values in the form