File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes EL s not running Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "EL s not running " Watch "EL s not running " New topic

EL s not running

Abhra Kar
Ranch Hand

Joined: May 22, 2008
Posts: 150
I hava to class in package foo.
package foo;
public class Person {
public String name;
public Dog dog;
public String getName() {
return name;
public void setName(String name) { = name;
public Dog getDog(){
return dog;
public void setDog(Dog dog){;
package foo;
public class Dog{
public String name;
public String getName() {
return name;
public void setName(String name) { = name;
and a servlet
import javax.servlet.*;
import javax.servlet.http.*;
public class s1 extends HttpServlet {
public void doGet(HttpServletRequest req,HttpServletResponse res)
throws IOException,ServletException{

foo.Person p = new foo.Person();

foo.Dog dog=new foo.Dog();
RequestDispatcher view =req.getRequestDispatcher("result.jsp");

now when I use this- Dog's name is : ${} in result.jsp then I get the output
Dog's name is : ${} instead of getting "spike"
but this is working fine --
<%= ((foo.Person) request.getAttriute("person")).getDog().getName() %>
Why ?
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

You probably did not set your web.xml properly. Check this FAQ, especially this section (servlets 2.4)

[My Blog]
All roads lead to JavaRanch
I agree. Here's the link:
subject: EL s not running
It's not a secret anymore!