• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Clarification Required

 
Ranch Hand
Posts: 517
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<c:catch var="a">
<%throw new ArithmeticException();%>
</c:catch>


Got an error 'Unreachable statement'.

c:catch could'nt catch this exception..WHY?
Request anyone to clarify.

Thanks
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Vinod,

(how come you're not yet banned on the forum with such an unrealistic last name? )

regarding your jsp, that's NOT a jstl problem.
If you put in your jsp only this code (I did it for you):


<BODY>
<%throw new ArithmeticException();%>
</BODY>




in the generated servlet _jsp.java you got (in the _jspService method):


out.write("<BODY>\r\n");
throw new ArithmeticException();
out.write("\r\n");
out.write("</BODY>\r\n");



and this will NOT compile because the compiler detects that the code after the throw statement is unreachable. You'll get this in any java class (with the recent compilers), this has nothing to do whith <c:catch>

The <c:catch> will catch the execution errors/exceptions, but this is a compilation one.

Hope this helps
gabb

[ April 04, 2006: Message edited by: gabb buda ]
[ April 04, 2006: Message edited by: gabb buda ]
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know what is unrealistic about the name, but even still it does not follow the proper format presented by the Javaranch naming policy.

After reading the policy, you can change your display name here.
 
MInu
Ranch Hand
Posts: 517
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply.
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Amateurs built google. Professionals built the titanic. We can't find the guy that built this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic