Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning 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
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Error in JSP : The end tag "</menu:ddmenu" is unbalanced

 
Greenhorn
Posts: 2
Tomcat Server Windows XP Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the Home.jsp file. The code is as follow


The Problem is given Message as follow


org.apache.jasper.JasperException: /Home.jsp(54,7) The end tag "</menu:ddmenu" is unbalanced
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:83)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:402)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:170)
org.apache.jasper.compiler.Parser.checkUnbalancedEndTag(Parser.java:1744)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1599)
org.apache.jasper.compiler.Parser.parse(Parser.java:171)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:247)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:149)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:135)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:237)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:456)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:552)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)>


The tags have been matched properly. I am unable to understand where is the exact problem?

Please help me.
 
Marshal
Posts: 67463
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First and foremost, this is 2012. Scriptlets and Java code inside a JSP has been discredited since 2002. That's 10 years ago. You should not be putting code into a JSP at this point. See what a mess your JSP is with all the mixed syntax?

You should bring your JSP knowledge up to date using the JSTL and EL, and stop putting Java code into the JSP.

Problems like this are just one of the many reasons that scriptlets are not longer acceptable.
 
Ravi Der
Greenhorn
Posts: 2
Tomcat Server Windows XP Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you sir for this good suggestion. But at now i am in beginner level so that's why i do this silly mistake in coding.
I must try to resolve this and adopt your suggestion.
But now can you please give me solution of this coding? becoz its very urgent for me and i continuous tried last one week but not success.

Thanks in advance.
 
Bear Bibeault
Marshal
Posts: 67463
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ravi Der wrote:Thank you sir for this good suggestion. But at now i am in beginner level so that's why i do this silly mistake in coding.


If you are a novice to JSP, it is doubly important that you abandon trying to use Java code and scriptlets in JSPs and to learn, from the outset, the correct ways to do things. Why start off by learning bad habits and poor practices?

But now can you please give me solution of this coding?


Sorry, I cannot. You are using practices that have been discredited for over 10 years and I cannot in good conscience help you down the wrong path.

becoz its very urgent for me


Two things:

First, the term 'urgent" is a bad one to use. It usually causes people to simply start to ignore you. Please read the link EaseUp for more information.

Secondly, please use real words when posting to the forums. Abbreviations such as "becoz" in place of "because" only serve to make your posts more difficult to read and less likely to generate useful responses. Please click this link ⇒ UseRealWords for more information.

I always recommend that novices to JSP read the following two articles:
  • The Secret Life of JSPs
  • The Front Man

  • Hopefully, they will help steer you in a better direction.
     
    Ranch Hand
    Posts: 290
    Debian Fedora Linux
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    In every post Bear Bibeault comments on follow Good Practise, thank's Bear Bibeault for helping us. :D
     
    Bartender
    Posts: 1845
    10
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I can see the intent here, and its not going to work.
    What you have in your loop in effect is this:



    The JSP compiler is complaining because it hits your closing custom tag before you've actually opened it.
    It can't understand the fact that there would have been one opened on a previous iteration of your loop in scriptlet code.
    There is no way around this apart from chosing a different approach with your code.

    I would suggest:
    - Write a bean which executes the query and saves the results into a bean/data structure
    - start with a simple one level menu
    - as Bear as said, don't mix scriptlet code and custom tags. its a recipe for disaster.
     
    Trust God, but always tether your camel... to this tiny ad.
    the value of filler advertising in 2020
    https://coderanch.com/t/730886/filler-advertising
    reply
      Bookmark Topic Watch Topic
    • New Topic