Results 1 to 11 of 11
  1. #1
    Join Date
    Feb 2004
    Posts
    6

    Unanswered: (Sevlets )Hide information shown on the url window of the browser

    Imagin i have a form with just one hyperlink.... clicking on hyperlink a servlet gets executed...now iam passing some values to the servlet from the hyperlink using ?val1="12334"&val2="abc".now these values r shown in the url of the browser window which i dont want.. Please dont tell me 2 use hidden text fields...i know it works with it....but i am looking 4 something else...

  2. #2
    Join Date
    Jan 2004
    Location
    Sochaux (France)
    Posts
    55

    Re: (Sevlets )Hide information shown on the url window of the browser

    Originally posted by delpinoh
    Imagin i have a form with just one hyperlink.... clicking on hyperlink a servlet gets executed...now iam passing some values to the servlet from the hyperlink using ?val1="12334"&val2="abc".now these values r shown in the url of the browser window which i dont want.. Please dont tell me 2 use hidden text fields...i know it works with it....but i am looking 4 something else...
    On your jsp you declared a <FORM> which default sent value is GET.
    Use a POST method : <FORM method="POST"> and you don't have any field in you URL...

  3. #3
    Join Date
    Nov 2003
    Location
    Jakarta, Indonesia
    Posts
    32

    Re: (Sevlets )Hide information shown on the url window of the browser

    You can use frame

    Originally posted by delpinoh
    Imagin i have a form with just one hyperlink.... clicking on hyperlink a servlet gets executed...now iam passing some values to the servlet from the hyperlink using ?val1="12334"&val2="abc".now these values r shown in the url of the browser window which i dont want.. Please dont tell me 2 use hidden text fields...i know it works with it....but i am looking 4 something else...
    Regards,
    Adam Ac

  4. #4
    Join Date
    Feb 2004
    Posts
    6

    Re: (Sevlets )Hide information shown on the url window of the browser

    Originally posted by venderic
    On your jsp you declared a <FORM> which default sent value is GET.
    Use a POST method : <FORM method="POST"> and you don't have any field in you URL...

    no buddy...cant use post with hyperlink since hyperlink can generate only get request..how do i use frames???will it help

  5. #5
    Join Date
    Jan 2004
    Location
    Sochaux (France)
    Posts
    55

    Re: (Sevlets )Hide information shown on the url window of the browser

    Originally posted by delpinoh
    no buddy...cant use post with hyperlink since hyperlink can generate only get request..how do i use frames???will it help
    False.
    You redirect your link into a javascript in which you make a form.submit...

    Code:
    <script language="javascript">
    	function fctConsulterVehicule(valeurAction, id)
    	{
    		...
    		ageVehicule.submit();		
    	}
    </script>
    <form name="ageVehicule" action="<%=ConstGen.SERVLET_REFERENTIEL%>" method="POST">
    	<table>
    ...
    	<a href="javascript:fctConsulterVehicule('<%=ConstReferentiel.ACTION_MODIFIER_AGE_VEHICULE%>', '')">
    	</table>
    </form>

    I work like this and i never had any problem...

  6. #6
    Join Date
    Nov 2003
    Location
    Jakarta, Indonesia
    Posts
    32

    Re: (Sevlets )Hide information shown on the url window of the browser

    create this 4 files:

    frame.html
    <html>
    <head>
    </head>
    <frameset id="mainFrameset" rows="0,*" border="0" framespacing="0">
    <frame name="blank" scrolling="no" noresize src="blank.html" marginwidth="0" marginheight="0" frameborder="0">
    <frame name="content" scrolling="no" noresize src="content.html" marginwidth="0" marginheight="0" frameborder="0">
    <noframes>
    <body>
    <p>This page uses frames, but your browser doesn't support them.</p>
    </body>
    </noframes>
    </frameset>
    </html>

    blank.html
    <html><head></head><body></body></html>

    content.html
    <html>
    <head>
    <title>Not Shown 1</title>
    </head>
    <body>
    Content 1<br>
    <a href="content2.html?anyparam=anyvalue">click me</a>
    </body>
    </html>

    content2.html
    <html>
    <head>
    <title>Not Shown 2</title>
    </head>
    <body>
    Content 2<br>
    <a href="content.html?anyparam=anyvalue">click me</a>
    </body>
    </html>

    create this 4 file in 1 directory and open frame.html

    Originally posted by delpinoh
    no buddy...cant use post with hyperlink since hyperlink can generate only get request..how do i use frames???will it help
    Regards,
    Adam Ac

  7. #7
    Join Date
    Feb 2004
    Posts
    6

    Re: (Sevlets )Hide information shown on the url window of the browser

    hi wendrich, thxs 4 help i really appreciate that.. What u exlained works when i am passing values to a servlet from a textfiels by redirecting the link to javascript no issues abt that.... but i still have some minor hiccups since the values r passed thro link...first i am not aware of JSP so if u can explain in servlets it will be more helpful... ok i will write a small code may be that will helpboth of us

    LINKHTML PAGE:

    <HTML>
    <BODY>
    <form name="firstform method="post" action="http://web:8080/...../LinkServlet?val1=abc&val2=xyz"> (!!!! passing initial values to the servlet called LinkServlet!!!!!)

    <a href="#" onclick="firstform.submit()">click servlet</a>
    </BODY>
    </HTML>

    Now when i click this link,the servlet gets both the value...no issues abt that but both these values r still shown in url of th browser window. Now tell me what shud be the modification in the HTML page..to avoid that...if u can help me out..it wud be gr8.

  8. #8
    Join Date
    Jan 2004
    Location
    Sochaux (France)
    Posts
    55

    Re: (Sevlets )Hide information shown on the url window of the browser

    Originally posted by delpinoh
    hi wendrich, thxs 4 help i really appreciate that.. What u exlained works when i am passing values to a servlet from a textfiels by redirecting the link to javascript no issues abt that.... but i still have some minor hiccups since the values r passed thro link...first i am not aware of JSP so if u can explain in servlets it will be more helpful... ok i will write a small code may be that will helpboth of us

    LINKHTML PAGE:

    <HTML>
    <BODY>
    <form name="firstform method="post" action="http://web:8080/...../LinkServlet?val1=abc&val2=xyz"> (!!!! passing initial values to the servlet called LinkServlet!!!!!)

    <a href="#" onclick="firstform.submit()">click servlet</a>
    </BODY>
    </HTML>

    Now when i click this link,the servlet gets both the value...no issues abt that but both these values r still shown in url of th browser window. Now tell me what shud be the modification in the HTML page..to avoid that...if u can help me out..it wud be gr8.
    Okay,
    u're not so far of what u're expecting for.
    The problem is that u put your values in the action.
    Just put the servlet you want to access to and hide youre values :
    Code:
    <HTML>
    <BODY>
    <form  name="firstform method="post" action="http://web:8080/...../LinkServlet">  (!!!! passing initial values to the servlet called LinkServlet!!!!!)  
    <INPUT TYPE="HIDDEN" name="val1" value="abc">
    <INPUT TYPE="HIDDEN" name="val2" value="xyz">
    <a href="#" onclick="firstform.submit()">click servlet</a>
    </BODY>
    </HTML>
    Now you can get your values in your servlet, and they are invisible for your user.
    And so, in your servlet, u can use the Service method to catch differently your DoPOst and DoGet action from your JSP...

    If you want more explain, just post here, i will try to help you...


    Just onr mor'e word, the solution using frame is right to, but your browser must support frames...
    Last edited by venderic; 02-11-04 at 04:25.

  9. #9
    Join Date
    Feb 2004
    Posts
    6

    Re: (Sevlets )Hide information shown on the url window of the browser

    Hi wendrich....Thanxs earnestly for helping out..But BUt .....i think we still r in a loophole..thxs for telling me 2 use hidden input fields..i knew it will work that way..(please look at my first posting)but i was trying 2 look 4 something else..In a small eg it is easy to use hidden fields..but when we look at it as a major project ..i dont want to depend on hidden fields....so any idea of crypting or decrypting....formulas???

  10. #10
    Join Date
    Jan 2004
    Location
    Sochaux (France)
    Posts
    55

    Re: (Sevlets )Hide information shown on the url window of the browser

    Originally posted by delpinoh
    Hi wendrich....Thanxs earnestly for helping out..But BUt .....i think we still r in a loophole..thxs for telling me 2 use hidden input fields..i knew it will work that way..(please look at my first posting)but i was trying 2 look 4 something else..In a small eg it is easy to use hidden fields..but when we look at it as a major project ..i dont want to depend on hidden fields....so any idea of crypting or decrypting....formulas???
    Okay, sorry for the last post.
    I thought you were looking for any solution whihc hide data to the user in the url bar, not for one solution with encrypting data.
    Just an info, i work in a big enterprise, and all our java/servlet/jsp project running on intranet are made like this.
    But applications openned on the internet are more secured, and i don't know how.
    I suppose they encrypt data, but when we receive them they are still decrypted...
    The hidden input like the post method are good because nothing is visible at fist time. But you can always catch the http packet and pick up information.
    I don't have another solution. Good luck for what you're looking for.

    To end our exchange, i think you will have the same problem with frames...

    best regards

  11. #11
    Join Date
    Feb 2004
    Posts
    6

    Re: (Sevlets )Hide information shown on the url window of the browser

    txs wenrich......ths 4 all ur effort and time....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •