Solved

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

Posted on 2004-10-07
4
2,759 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
JSP Popup page 2 115
report generation frameworks 1 64
parse example 13 94
Suggestion on WebSite Template Sites 6 100
For months I had no idea how to 'discover' the IP address of the other end of a link (without asking someone who knows), and it drove me batty. Think about it. You can't use Cisco Discovery Protocol (CDP) because it's not implemented on the ASAs.…
An article on effective troubleshooting
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

806 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