Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

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

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Suggested Solutions

Title # Comments Views Activity
some methods private some are not 8 217
TreeSet comparator example 7 97
using if condition without JSTL 2 111
main method of string class 3 117
Giving access to ESXi shell console is always an issue for IT departments to other Teams, or Projects. We need to find a way so that teams can use ESXTOP for their POCs, or tests without giving them the access to ESXi host shell console with a root …
Learn how to PXE Boot both BIOS & UEFI machines with DHCP Policies and Custom Vendor Classes
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…

808 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