I have a simple form in my JSP, which I dont want it to refresh the page when I click submit, so I submit the form in background by Ajax.
however, the code of Ajax/JS is easy to find by following the src in the source code of JSP.
Can I hide a Ajax/JS in a JSP, or can I run a Ajax/JS code in server side?
thank you all.
If you want to hide algorithms, etc etc. do all your processing on the server side and just send plain HTML in responses. Naturally this will be slower. Making a "Rich Internet Application" just naturally exposes what you are doing on the client side.
Bear Bibeault wrote:I'm still wondering why this is viewed to be a problem.
first things first, thanks.
because I dont want the people can submit a form by just typing a address in url bar, that why viewed is a problem.
and i know that php can do this so im just wonder could jsp can do the same thing as below:
Lek Kin Wong wrote:by the way, i also have another question,
i just install tomcat7.0.2 in ubuntu10, but i found Ajax cannot read a file, also the layout of the web is different from Windows...
i want to put a "*" and the text input in the same line, here is the code which work in Windows but not Ubuntu...
David Newton wrote:You could do the exact same thing.
But it won't do anything like you're asking: even if I don't try to load the page containing the JS it's *still* in my browser and I can just look at it from the original page.
And *any* request you make from the browser can be made manually.
oops, I see and many thanks.