|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
1200+ fellow developers rate and compare features of the top IDEs, like Visual Studio, Eclipse, RAD, Delphi and others, across 13 categories. Enjoy this FREE Download of the IDE User Satisfaction Study by Evans Data Corporation. Download Now!
|
|
#1
|
|||
|
|||
|
Variables
Hello, I am just curious if a variable is not defined in the JSP page, but is passed through the URL if can be accessed in the page? For exampe:
URL <sample.jsp> <HTML> <% if (variable == "test") { out.println("Variable = test\n"); } %> </HTML> |
|
#2
|
|||
|
|||
|
A variable doesn't appear automatically like it does in php. You can grab a query string variable like this:
<% String myvariable = request.getParameter("variable"); %> Also you can't test for string equality the way you did. if(variable == "test") would test if variable and "test" were the actual same object not just the same characters. you need if(variable.equals("test")) . outprintln() also includes a line return already so you don't need the \n |
|
#3
|
|||
|
|||
|
Quote:
ok thanks for the help, i appreciate it... but i have another question, does jsp allow you to encrypt objects in the query string... for example in coldfusion i could encrypt the value of variable with something like this : <CFSET variable2 = Encrypt(key, variable)> this just adds a little more peace of mind when dealing with user information. |
|
#4
|
||||
|
||||
|
Take a look at http://www.jguru.com/faq/view.jsp?EID=446031 it might help
__________________
My blog about OpenSource Databases PDF tutorials about OSS databases, DBMonster ... Please contribute to Open Source Development, fill bug reports!!! Developer Shed eSupport Commented my.ini/my.cnf (PLEASE ADD YOUR OWN CONFIG TRICK) An introduction to database normalization Natural or Surrogate key Custom ordering for your results Correlated and uncorrelated subqueries Don't turn your outer joins into inner joins |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > Variables |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|