wood burning stoves 2.0*
The moose likes Servlets and the fly likes problem in html Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "problem in html" Watch "problem in html" New topic
Author

problem in html

hong zhang
Ranch Hand

Joined: Jun 07, 2001
Posts: 30
A very strange thing happen in my html/servlet.
I had a html page that take user's input and than the servlet save into database. When the input contains a "/", it interpret as a "a". For example, I put "hong_zhang/email", it will display as "hong_zhangaemail".
I user websphere as the server and oracle database.
Any idea to help me out this weird situation?
Thanks in advance.
Hong
Brian Glodde
Ranch Hand

Joined: Jun 27, 2001
Posts: 171
You might try placing an escape character in front of the forward slash ""hong_zhang\/email". This tells java to consider the next character as a literal.
hong zhang
Ranch Hand

Joined: Jun 07, 2001
Posts: 30
Brian,
I tried and with no luck. I input "hong_zhang\/email" and the result is "hong_zhangaaemail" the "\" escape character interpret as "a" with a tail on top of it.
Any ideas?
Originally posted by Brian Glodde:
You might try placing an escape character in front of the forward slash ""hong_zhang\/email". This tells java to consider the next character as a literal.

Malhar Barai
Author
Ranch Hand

Joined: Aug 17, 2001
Posts: 399
nope buddy,
but if u get the solution, do write it to me, coz the prob sounds great enough to ponder
good luck
malhar


Malhar Barai
SOA & Java Book
Jim Wang
Ranch Hand

Joined: Oct 04, 2001
Posts: 41
where do you find your input was changed. At the point when your servlet get it, like [ String str = request.getParameter("url"); System.out.println(str); ] or you get it on the feedback page ?
hong zhang
Ranch Hand

Joined: Jun 07, 2001
Posts: 30
Jim,
I find it out in the request.getParameter.
In the servelet I did:
PrintWriter out;
res.setContentType("text/html");
out = res.getWriter();
Is there something on WebSphere did not setup correctly? Or I missed somthing? I use the same code and run on Tomcat, it runs fine.
Any idea will be very much appreciated.

Originally posted by Jim Wang:
where do you find your input was changed. At the point when your servlet get it, like [ String str = request.getParameter("url"); System.out.println(str); ] or you get it on the feedback page ?

Jim Wang
Ranch Hand

Joined: Oct 04, 2001
Posts: 41
My server is Tomcat too. If you are sure this thing happened before your servlet get the input. You may test it on different browsers to whether you need to correct your setting. Another way is use a javascript function change '/' to a rarely used charactor. It's not a good solution, but it may make your code work.
J
hong zhang
Ranch Hand

Joined: Jun 07, 2001
Posts: 30
Jim,
Thanks for your reply.
I still have no clue why the browser doesn't take "/" and interpreted as "a". In fact, it doesn't take any special character, like "%", "!", "$", etc.
I need that "/" in the field as it is used as email address. How I use javascrip to accomplish it. Could you elaberate a little more, or possibly give some examples.
Thanks,
Hong
Frank Lin
Ranch Hand

Joined: Jan 26, 2001
Posts: 76
Hong,
The problem might have something to do with websphere setup. Check the code page or code set setting.
hong zhang
Ranch Hand

Joined: Jun 07, 2001
Posts: 30
Originally posted by Frank Lin:
Hong,
The problem might have something to do with websphere setup. Check the code page or code set setting.

Frank,
Thanks for your reply. I thought it was websphere issue, but I just don't know where to start. You mention about the "code page" or "code set" setting, could you explain more in detail. I'm not familiar with websphere admin, only use it as the web application server. The person set up did not have clue about the problem.
Thanks in advance.
Hong
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16228
    
  21

A "Code Page" is a mapping of bits onto an alphabet.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem in html