Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Royally stumped with jstl <c:if test of request.method

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using eclipse to build jsp pages that run on weblogic 9. The problem I am having is that code that works in all my other pages seems to be failing for my login.jsp page.

If I use in my <body>:



it complains that POST is an invalid character constant. It then also whines about the LoginContext loginContext line saying there is a javax.servlet.ServletException as well. If I change the double equal sign (==) in the <c:if test line to a single equal sign (=) sign, the errors go away, but of course that is wrong. I tried cutting and pasting the lines into a file, removing login.jsp and then putting back in the lines, but that did not help. I stripped down the file so that all it had in the body was this ><c:if stuff as well, and that did not help. I am baffled as this stuff works fine in my other jsp pages. I have even commented out all the java code in the ><c:if line and removed all imports that are at the top for it as well with no luck. I am hoping this is just something stupid on my part, and your help would be greatly appreciated.

Here is the full page code as it stands now:



 
Mr.David Shapiro
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see thet extra great than sign (>) on the first line, but I do not see that in eclipse. I don't think it is in my login.jsp. It must have gotten in during pasting the code there I suspect.
 
Mr.David Shapiro
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It gets weirder. If I put

anywhere in the <form> block the error goes away. Yes, I had to add at the top


What is going on?
 
Marshal
Posts: 67451
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Firstly, I'd string recommend strongly against mixing JSTL/EL and scriptlets on a JSP page, use scriptlets or use JSTL, not both. They were never meant to co-exist. Though I'm not thinking that's part of the issue.

Just for giggles, have you tried to see what happens if you use eq in place of == ?


P.S. You can edit your post to remove the extraneous character.
 
Mr.David Shapiro
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
eclipse did not show errors, but I ended up having to provide an empty stylesheet for the transform command:
 
Mr.David Shapiro
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I used eq instead of == after commenting out transform/xml stuff and I get the same error.
 
reply
    Bookmark Topic Watch Topic
  • New Topic