wood burning stoves 2.0*
The moose likes JSP and the fly likes <jsp:setProperty> is raising Exceptions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "<jsp:setProperty> is raising Exceptions" Watch "<jsp:setProperty> is raising Exceptions" New topic
Author

<jsp:setProperty> is raising Exceptions

Graeme Byers
Ranch Hand

Joined: Apr 16, 2004
Posts: 127
Two problems. Thank you for any help.

JavaBean :


Problem 1 :

The following JSP correctly displays 1 = Tom , 2 = Tom 3 = Tom


Uncomment the <jsp:forward> and NextPage.jsp correctly displays 4= Tom , 5 = Tom
but why the JasperException ?


Problem 2 :

Both getSomeValue and getSomeValueEL correctly display X.

But why are the exceptions raised for someKey ?
Why is the standard action and EL aware that it's an int ?
That's a 'private' implementation - I thought that only the names of getter and setter methods mattered.

The real point is : how do you handle a JavaBean when its properties are not String ?
Hans Bergsten's JSP speaks of property editors being used to handle Date (I've not reached Ch 22 yet). Is that the solution ?


Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60804
    
  65

  • Why are you forwarding after emitting content? That's bound to cause problems and should never be done. What's the intent with the forward?


  • If you are writing modern JSP, the setProperty action should be jettisoned in favor of the <c:set> action using the "target" format.


  • I don't know where you picked up that really odd Java code formatting, but it's unlike any convention in popular use and makes your code almost impossible to read. I'd revisit that decision and adopt a more conventional formatting approach.



  • [Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: <jsp:setProperty> is raising Exceptions
     
    Similar Threads
    JasperException / ServletException when using useBean
    JasperException
    JSP et Bean JasperException
    JasperException from non-numeric parameter value
    JasperException