Solved

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

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now