[jboss-user] [Tomcat, HTTPD, Servlets & JSP] - ${variable.member} does not work!

c-e do-not-reply at jboss.com
Fri Sep 29 13:01:59 EDT 2006


Hi,

I am exploring Enterprise Java with JBoss 4.0.2 - I am trying to access and trying print out members via the expression language EL and face two problems: 

- access to a scripting variable does not cause an error but also does not print out the variable's content

- acces to a scoped variable causes an error when requesting the jsp

Do you have any idea?

Here is the jsp's source code:

<%! class Test {
		private int number;
		public int getNumber() { return number; }
		protected void setNumber(int number) { this.number = number; }
	}
	
%>

<% 
	Test local = new Test();
	local.setNumber(3);

	application.setAttribute("global", local);
%>


	<%-- No error but also no output! --%>
	${local.number}  


	<%-- Error! 

	${global.number} 

	description:
	The server encountered an internal error () that prevented it from fulfilling this request.	
	
	exception: 
	javax.servlet.ServletException: javax.servlet.jsp.el.ELException: An error occurred while getting property "number" from an instance of class org.apache.jsp.sample_jsp$Test
	...
	
	root cause:
	java.lang.IllegalAccessException: Class org.apache.commons.el.ArraySuffix can not access a member of class org.apache.jsp.sample_jsp$Test with modifiers "public"
	...
	
	--%>

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3975191#3975191

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3975191



More information about the jboss-user mailing list