Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Another Newb failing at HF Servlets & JSP Beer Example

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First off,

relax. I didnt fail completely . Its just the last step involving an actual JSP file that troubles me. My deployment structure is as given in the book. Each of the previous examples worked fine. Now, building in the result.jsp my fox gives me the following:



Now, i cant get smart of this....Here are my files:

Its the BeerExpert.java :



The BeerSelect.java



The web.xml



And, ofc. the result.jsp



Thanks in advance.
 
Bartender
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

org.apache.jasper.JasperException: /result.jsp(1,5) Invalid directive



Here where it comes from,

, where it should be



You are using an import statement but there's no directive called import but page and import is an attribute of it.
This will solve your problem
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A little hint:

<%@ import="java.util.*" %>


is a "directive", and it's where the error occurs. The other files are not relevant to this problem. Consult the book or the JSP specification on what the valid directives are, and what their syntax is.
 
Kai Karius
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!

Tanks, i checked the statement. Ofc, it should read:

<%@ page import="java.util.*" %>



Guess i was so glad to see some familiar Java that i didnt consider the differences.

Thank you very much,

TWERP
 
reply
    Bookmark Topic Watch Topic
  • New Topic