• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSP failed validation from validator

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've been trying to compile a JSP and been receiving the error below. Not sure what the issue and how to fix it.
Any help with this regard is appreciated. I can provide more details, if needed.

Thanks much.

weblogic.utils.compiler.ToolFailureException: jspc failed with errors :weblogic.servlet.jsp.CompilationException: editAdjustment.jsp:436:212: The page failed validation from validator: "Illegal text inside "c:choose" tag: "<input ...".".
onclick="loadCheckHiddenValue(this); toggleSectznRows(this.checked); disableNonSectznRows(this.checked); changeFieldState('regulatoryVal<c:out value='${varStatus.count}'/>','<c:out value='${varStatus.count}' />')"
^----------------------------------^
editAdjustment.jsp:436:212: The page failed validation from validator: "Illegal child tag in "c:choose" tag: "c:out" tag".
onclick="loadCheckHiddenValue(this); toggleSectznRows(this.checked); disableNonSectznRows(this.checked); changeFieldState('regulatoryVal<c:out value='${varStatus.count}'/>','<c:out value='${varStatus.count}' />')"
^----------------------------------^
editAdjustment.jsp:439:66: The page failed validation from validator: "Illegal text inside "c:choose" tag: ""
...".".
<input type="hidden" name="<c:out value="${status.expression}" />"
^------------------------------------^
editAdjustment.jsp:439:66: The page failed validation from validator: "Illegal child tag in "c:choose" tag: "c:out" tag".
<input type="hidden" name="<c:out value="${status.expression}" />"
^------------------------------------^
editAdjustment.jsp:440:54: The page failed validation from validator: "Illegal text inside "c:choose" tag: "_hidden...".".
id="regulatoryVal<c:out value="${varStatus.count}"/>_hidden"
^---------------------------------^
editAdjustment.jsp:440:54: The page failed validation from validator: "Illegal child tag in "c:choose" tag: "c:choose" tag".
id="regulatoryVal<c:out value="${varStatus.count}"/>_hidden"
^---------------------------------^
editAdjustment.jsp:441:98: The page failed validation from validator: "Illegal text inside "c:choose" tag: "'
...".".
value='<c:choose><c:when test="${status.value}">TRUE</c:when><c:otherwise>FALSE</c:otherwise></c:choose>'
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch!

Looks like a syntax error in your JSP code. Could you post the relevant portion of the code? (be sure to UseCodeTags)
 
Mark Annem
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Below is the relevant code from lines 420 to 445. Hope, I've included the codeTags correctly.


 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The input tag at line 20 is illegal because <c:choose> can only contain <c:when> or <c:otherwise> tags -- it makes no sense to have markup outside one of those tags. What is your intent for that input markup? Should it be part of a "when", or part of an "otherwise"?
 
Mark Annem
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay, I have this error with all the 3 <input> tags. Not just the one at line# 20. And I observed that the input tag inside the choose is causing only for the types 'hidden' and 'checkbox'. In the same JSP, I have few radio buttons and few select dropdown fields. Either radio button or the dropdown input tags are working perfectly fine but the hidden and checkbox input elements.

I tried attaching the whole of my jsp, but the system won't let me attach files with extension .jsp or .txt. So, uploaded the whole of the jsp at http://textuploader.com/0l5p.
 
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Regardless of how the error messages describe it, it's still (like Bear says) not valid to have any elements inside a <c:choose> element except for <c:when> and <c:otherwise> elements. So you're going to have to do something about the <input> element you showed us and the other ones, which presumably are similar.
 
Paul Clapham
Marshal
Posts: 28177
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's quite possible that you have missing end tags which are causing problems, although it's very hard to tell by looking at the code you uploaded. You have such extreme levels of indentation that half of each line slops over into the next line, which makes it very hard to tell what goes with what. I know this sort of thing is hard to avoid in a language which doesn't allow you to break a block of code off into a separate method, but reducing your indentation to two spaces instead of eight might help.
 
Mark Annem
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Got a fix for this issue finally....

From the sample code that I've posted earlier, I've moved the HTML element '<input type="hidden"....> right after the 2nd <c:when...> tag from <c:choose> to the outer <spring:bind.....>.

Here's the new code after the fix.

Thanks for your advises Bear and Paul... Appreciate your help.
reply
    Bookmark Topic Watch Topic
  • New Topic