This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
i am new to jsp eclipse programming. i am using eclipse to build the jsp page where it use tomcat 5.5 as application server to run the page. now i have 2 jsp pages. page one display the link of filename from SAP BO when user click this filename then it should display the values which is generated in the file. now problem is suppose the file name is : sales revenue. when i click the link the parameter value is trimmed to "sales". space is eliminated. my coding
out.println("<a href=New.jsp?sDocName="+res+" target=_blank > click to view SQL and Export to Repository : "+res+" </a>");
where res is the variable. please help to me solve this. i have searched the forum found some notes but not helping. thanks
I think if you looked at the HTML which was generated by that code -- which you should have done right away -- you would find that it was bad HTML. In particular I think you would find that the attribute values were missing the quotes around them.
However, having said that, you shouldn't have Java code in a JSP anyway. And using Java code to call out.println and write HTML is particularly wrong, because it's completely unnecessary. You could achieve the same result by just putting that HTML directly into the JSP (remember, the purpose of the JSP is to generate HTML) without any scriptlet junk.
P.S> Your problem is likely that the resulting HTML is malformed. Do a View Source at the browser to see the generated HTML.
Joined: Feb 13, 2013
thanks all for the reply
can i get the correct code in this scenerio.
if possible please post the rewritten code for this to work.
as i mentioned i don`t know any of this coding just used to get the results which i wanted, most of them from internet. almost 95% done, if i can do this then task completed.