[Tomcat, HTTPD, Servlets & JSP] - Using annotations in JSP gives JasperException
by jainsau
I am using JBoss 4.2 GA and created a simple EJB app and a web client. When I annotate an ejb interface variable as @EJB in a JSP file (I know it is not a good idea to access EJBs in JSPs but this is just a test program) , and try to access the JSP I get the following error:
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 5 in the jsp file: /index.jsp
Syntax error, annotations are only available if source level is 5.0
2: <%@page import="javax.ejb.EJB"%>
3:
4: <%!
5: @EJB
6: private Convertor converter;
7: public void jspInit() {
8: try {
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:415)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:308)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
---------------------------------------------
Seems like JASPER is not supporting annotations in default server configuration in JBoss 4.2 GA. Am I right or do I need to make some other configuration changes so that my web app is jdk 5.0 enabled?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4062005#4062005
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4062005
18Â years, 9Â months
[JBoss Seam] - Multiple Seam DataModelSelection in one action: Selection do
by bram_
Hi,
We have an abstract action to select the current object using DataModel
and DataModelSelection annotation.
For some reason we need a secondary list/current in the same action,
so I added this in the ActionImpl including a specific name:
| @DataModel(value = "organizationalLevelConnections")
| private Collection<OrganizationalLevel> organizationalLevels;
|
| @DataModelSelection(value = "organizationalLevelConnections")
| private OrganizationalLevel currentOrganizationalLevel;
|
I've also added names to the annotations of the generic list/current:
| @DataModelSelection(value = "searchResults")
| protected T current;
|
| @DataModel(value = "searchResults")
| protected Collection<T> searchResults;
|
Now all the standard List/Current and the secondary list/current won't
correctly selec, including all list/current datamodels in all other action-classes, because these extend the AbstractAction.
Both have been named, both have public accessors.
Can anyone tell me what I'm doing wrong?
An example with selection and multiple (named?) DataModel(Selection)
annotations in the same class would be helpful.
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4061996#4061996
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4061996
18Â years, 9Â months