Solved

jsp tag error...

Posted on 2012-04-02
3
398 Views
Last Modified: 2012-04-02
In the attached file, I have a jsp page giving an error (the error is also included in the attached txt file).

removing code, changing:

<% com.wrox.library.Book myBook = new com.wrox.library.Book("Begining JSP Web Development"); %>

Book Title:
<%= myBook.getTitle() %>

to

Book Title:

brings up the isp page but not with the code.

Question: Why am I getting the exception?


Thank you.
Error-html-class.txt
0
Comment
Question by:Mike Eghtebas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 27

Accepted Solution

by:
rrz earned 500 total points
ID: 37797458
The code you posted works.
The error message is really not clear.
>java.lang.NoSuchMethodError: com.wrox.library.Book.<init>(Ljava/lang/String;)V  
But generally the "v" at the ends means wrong version of class file. So, I suggest that you remove the class file that you have in your web app's classes folder and replace it with a new compilation of your current code.
0
 
LVL 34

Author Comment

by:Mike Eghtebas
ID: 37797701
Thank you.

Also I had out.print missing

<% out.println(myBook.getTitle()); %>
0
 
LVL 27

Expert Comment

by:rrz
ID: 37798917
Thanks for the points.  
>Also I had out.print missing  
No, actually you had  
><%= myBook.getTitle() %>  
which is fine.  That is a JSP expression.  <%="this will be printed %>  
><% out.println(myBook.getTitle()); %>
This is a scriptlet. Yes, use the print method.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How To Remove a Principal from HttpServletRequest 4 53
Getting NoSuchMethodError on accessing a spring mvc project 3 173
lessBy10  challenge 15 95
null output 3 42
Always backup Domain, SYSVOL etc.using processes according to Microsoft Best Practices. This is meant as a disaster recovery process for small environments that did not implement backup processes and did not run a secondary domain controller that ne…
Building a cohesive image for your brand is vital to making an impression on consumers. When the economy is tough, brands do better than unbranded  products. This can have a huge impact on your long-term profits, as the economy goes up and down.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question