The Source for Java Technology Collaboration

Home » java.net Forums » GlassFish » GlassFish

Thread: annotations

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 2 - Last Post: Nov 1, 2005 11:52 PM by: toshe
toshe

Posts: 7
annotations
Posted: Oct 31, 2005 8:24 AM
  Click to reply to this thread Reply

Hi,

Does anyone have examples using annotations in the web contaner of GlassFish? I need examples how to annotate servlet, JSP page ot tag handler (java or tag file).
Using the old schema(2.4) seems that no annotations are used. When i try to specify 2.5 schema in web.xml i receive this exception:
Caused by: org.xml.sax.SAXParseException: TargetNamespace.1: Expecting namespace 'http://java.sun.com/xml/ns/j2ee', but the target namespace of the schema document is 'http://java.sun.com/xml/ns/javaee'.

Thanks,
Todor

dochez

Posts: 48
Re: annotations
Posted: Oct 31, 2005 4:48 PM   in response to: toshe
  Click to reply to this thread Reply

Hi Todor

you are right, if your descriptor specify J2EE 1.4 or previous, we will not even try to process annotations. Now your namespace problem is puzzling, it should not behave like this. Which build are you using ?

to find examples, checkout the appserv-tests module and then go under devtests/web, all the directories starting with servletResourceInjection will contain annotated and Java EE 5 deployment descriptor file.

HTH, Jerome

toshe

Posts: 7
Re: annotations
Posted: Nov 1, 2005 11:52 PM   in response to: dochez
  Click to reply to this thread Reply

Hi,

It was build 22. With the new build 24 I managed to deploy javaee application, but experienced some problems with annotations. The problem is that I can use annotation @InjectionComplete on method in servlet, but on methods declared in JSP, tag files or java tag handlers it causes no effect.

Best Regards,
Todor




 XML java.net RSS