•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 402,522 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,595 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 537 | Replies: 3
![]() |
| |
•
•
Join Date: Nov 2007
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
Hello,
I've been trying to figure this out but still no luck, can anyone see what im doing wrong here?, the if statement just isn't working!
Thanks,
I've been trying to figure this out but still no luck, can anyone see what im doing wrong here?, the if statement just isn't working!
Thanks,
<% String name = request.getParameter("username"); %>
<% if ("name" == null) { %>
<jsp:forward page = "invalid.jsp"/>
<% } %>
What are you trying to accomplish with
Comparing a string literal to null will always be false.
if ("name" == null) Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Well "name" (when you use quotes) is a value not a variable. So the value "name" will never be equal to the value null.
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
![]() |
•
•
•
•
•
•
•
•
DaniWeb JSP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Dropper.Small.4.AG Virus (Viruses, Spyware and other Nasties)
- trojan horse dropper.small.4.ag virus help (Viruses, Spyware and other Nasties)
- MS Small Business Server: Does anyone know about security vulnerabilities? (IT Technologies and Trends)
- Java Game Applet Too Small (Java)
- How to Enable ICS on a Home or Small Office Network Connection in Windows XP (Windows tips 'n' tweaks)
- small fonts (Web Browsers)
Other Threads in the JSP Forum
- Previous Thread: illegal start of expression
- Next Thread: Java Hosting



Hybrid Mode