Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Rainhard Fischer   on Jul 17 In Java Category.

  
Question Answered By: Cambria Lopez   on Jul 17

Thanks and I understand that. But my question is, why can't i simply
declare that line?
Try these 2 line  of codes:

<%! String result = java.net.URLEncoder.encode("Hello World", "UTF-
8"); %>
<%= result %>

It won't work, but directly print the value and it works  fine:

<%= java.net.URLEncoder.encode("Hello World", "UTF-8") %>

Share: 

 

This Question has 1 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on jsp declaration bug? Or get search suggestion and latest updates.


Tagged: