Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, In my jsp page, I have de

Status
Not open for further replies.

112055

Programmer
May 13, 2002
61
US
Hi,

In my jsp page, I have declared browser as follow,

<%
String browser = Sys.stripNull(request.getParameter(&quot;browser&quot;));
if(!browser.equals(&quot;&quot;)) browser += &quot; &quot; + Sys.stripNull(request.getParameter(&quot;version&quot;));
%>

and follow that, I put in the html ...

<CENTER><B>We're sorry but your browser:<BR><%=browser%><BR>will not run this application correctly.


what happens here is when the page runs, the html shows up like ...


We're sorry but your browser:
Netscape 4.79 [en] (Windows NT 5.0; U)


what is this [en] and U, which does not make any sense.
what causes these funny characters to show up?
thanks for any help.

ni
 
I guess &quot;en&quot; means English version. I donn't know what U means after NT. However, you can easly remove them with StringTokenizer.
 
or replace function:
<%
browser=replace(browser,&quot;UN&quot;,&quot;&quot;);
browser=replace(browser,&quot;U&quot;,&quot;&quot;);
%>
...
><%=browser%><BR>will not run this application correctly.


Known is handfull, Unknown is worldfull
 
Thanks for the ideas fellas.

vbkris,
I got a compile error, it looks like they do not like the word 'replace', any idea?

org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.

Generated servlet error:
Method replace(java.lang.String, java.lang.String, java.lang.String) not found in class org.apache.jsp

browser=replace(browser,&quot;EN&quot;,&quot;&quot;);

browser=replace(browser,&quot;U&quot;,&quot;&quot;);

libaax,
Right off the top, not sure how to do that, but will dig deep to see how this can be done. Thanks.
 
I've looked into [EN} and U, as libaax said, [EN] means english and U means US. At first I thought it was some junk that was being picked up from the browser call, now I understand it is quite harmless. I am going to leave it as is. Thanks for helping me.
 
I think the format is:

browser=browser.replace(EN&quot;,&quot;&quot;);

browser=browser.replace(&quot;U&quot;,&quot;&quot;);
 
what 4345487 is javascript format. i am totally confused (i program in VB,Java,PHP)...

so try that also....

:(

Known is handfull, Unknown is worldfull
 
Why don't try creating your own replace method.Create a utility class and a static method that replaces your String and outputs the desired String?

Salih Sipahi
Software Engineer.
City of Istanbul Turkey
s.sipahi@sahinlerholding.com.tr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top