aspose file tools*
The moose likes BEA/Weblogic and the fly likes JSP failed validation from validator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "JSP failed validation from validator" Watch "JSP failed validation from validator" New topic
Author

JSP failed validation from validator

Mark Annem
Greenhorn

Joined: Jun 02, 2014
Posts: 4
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>'
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61761
    
  67

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)


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Mark Annem
Greenhorn

Joined: Jun 02, 2014
Posts: 4
Below is the relevant code from lines 420 to 445. Hope, I've included the codeTags correctly.


Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61761
    
  67

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

Joined: Jun 02, 2014
Posts: 4
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.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18987
    
    8

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
Bartender

Joined: Oct 14, 2005
Posts: 18987
    
    8

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

Joined: Jun 02, 2014
Posts: 4
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP failed validation from validator