This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes my jsp is showing too much in the browser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "my jsp is showing too much in the browser" Watch "my jsp is showing too much in the browser" New topic
Author

my jsp is showing too much in the browser

Ray Smilgius
Ranch Hand

Joined: Jan 29, 2001
Posts: 120
Below is the code for a jsp page problem is it will display the

<!%
public void WriteHeading(String sTitle, bool bIncludeButtons, JspWriter out)
{
String stTitle = sTitle;
if (stTitle.equals(""))
{
stTitle = "InScope";
}
out.print("<font color=\"red\">");
out.print("hi");
out.println("</font>");


}
%>
<%
out.print("<font color=\"red\">");
out.print("hi");
out.println("</font>");
%>
heres the output browser IE 5.0
"); out.print("hi"); out.println(""); } %> hi
the last hi on this line is red

Any ideas I dont want anything showing in the browser from this function unless it is called.
Thanks ray
[ January 21, 2002: Message edited by: Ray Smilgius ]
[ January 21, 2002: Message edited by: Ray Smilgius ]

SCJO, SCJD, SCWCD, I-Net+, A+, Network+, MCSD, MCDBA, MCP, MCT
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
It looks to me like that last chunk is not in the writeHeading method but is a scriptlet.
Roy Ben Ami
Ranch Hand

Joined: Jan 13, 2002
Posts: 732
i think it a typo but thats whats wrong.
u used <!% instead of <%!
change it and it will work.
Ray Smilgius
Ranch Hand

Joined: Jan 29, 2001
Posts: 120
Thanks, How could I have overlooked this detail? I must be prone to error, I will check my chipset for a bios update
Thanks ray
[ January 21, 2002: Message edited by: Ray Smilgius ]
Roy Ben Ami
Ranch Hand

Joined: Jan 13, 2002
Posts: 732
im glad i could help a pro like yourself.
just shows we little guys count also
im sure ill need your advices more than once so im glad i could help !
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: my jsp is showing too much in the browser
 
Similar Threads
I need to write a char array to file
what's the # btw include , pageContext.include and jsp:include
Writing a char array to a file
Why the class can't handle the taglib correctly?
Exception