Solved

about response.getWriter().println() in javaBean???

Posted on 2004-10-07
4
2,770 Views
Last Modified: 2009-12-16
hi,experts:
now i hava a jsp page:a.jsp
<jsp:useBean id="idmy" class="com.my.Ex" scope="page"/>

<html>
<body>
   aaaaaaaaaa<br>
   <%=idmy.pt(response,"mystr")%>
</body>
</html>

com.my.Bx:
public class Bx
{
    public static void pt(HttpServletResponse response,String str){
      //response.getWriter().flush();
      response.getWriter().println(str);
   }
  ....
}

when i deplay a.jsp in resin web server&#65292;i see the html source:
<html>
<body>
aaaaaaaaaaaaa
mystr
</body>
</html>

but when in tomat or jboss web server,the html source is:

mystr
<html>
<body>
aaaaaaaaaaaaa
</body>
</html>

now i want to get sample source in tomcat,like this
<html>
<body>
aaaaaaaaaaaaa
mystr
</body>
</html>
how can i do it? thanks!
0
Comment
Question by:hgbdelphi
  • 2
4 Comments
 
LVL 1

Expert Comment

by:sunil_bandaru
ID: 12247463
try removing the = from the following statement

<%=idmy.pt(response,"mystr")%>

like this:

<%idmy.pt(response,"mystr")%>
0
 

Author Comment

by:hgbdelphi
ID: 12255134
sorry,this is my mistake,i not this mean ,
<%idmy.pt(response,"mystr")%>
the error is either!

thanks!
0
 
LVL 11

Accepted Solution

by:
sompol_kiatkamolchai earned 100 total points
ID: 12255668
try adding ; in scriptlet like this

<%idmy.pt(response,"mystr");%>
0
 

Author Comment

by:hgbdelphi
ID: 12264841
thanks,now i can work well when i change the code like this:

public class Bx
{
    public static void pt(javax.servlet.jsp.JspWriter out,String str){
      //response.getWriter().flush();
      out.println(str);
   }
  ....
}
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Always backup Domain, SYSVOL etc.using processes according to Microsoft Best Practices. This is meant as a disaster recovery process for small environments that did not implement backup processes and did not run a secondary domain controller that ne…
In order to fulfill our mission of inspiring learning in the technology community, Experts Exchange is launching a Course of the Month program. Premium and Team Account members will have access to one course per month as a part of their membership, …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question