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 usage Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "EL usage" Watch "EL usage" New topic

EL usage

trivikram Kumar
Ranch Hand

Joined: Feb 21, 2005
Posts: 172
Hi pals,
I tried a lot to get the request attributes using EL.
I got it using scripting.
Its the same as example on page 366 in HF.
When i used EL it gives an error saying :
"Unable to find a value for "Dog" in object of class "com.example.person" using operator ".""
I am breaking my head since yesterday morning..but could not get it right.
If anyone knows how to solve this,please help me out as I am stuck here and am not able to proceed further.

Thanks in advance,

Javainn<br /> <br />SCJP,SCWCD,SCBCD,<br />ICED (IBM-287,IBM-484,IBM-486)
IBM certified in DB2 V 8.1 Family Fundamentals (IBM 700)
Ganeshji Marwaha

Joined: Sep 16, 2004
Posts: 27
You might try posting some code, so that we can try and figure out if there is any issue.

-- Ganeshji Marwaha<br />SCJP<br />SCWCD<br />SCBCD<br />MCP, MCP+SB, MCSD
trivikram Kumar
Ranch Hand

Joined: Feb 21, 2005
Posts: 172
Hi Ganesh,

here is my complete code.
Please try to figure out where the problem lies.
I am getting it worked with ${} but not with ${}
If there is any doubt regarding my presentation..please ask me.

Thanks in advance,

first file:

form1.html(I am calling this from IE)

<form method="post"action="">
<h1>Testing usage of Scriptless JSP's</h1>
<input type="submit"value="submit">

2nd goes to this servlet next)

package com.example;
import com.example.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
public class Test extends HttpServlet
public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException,
PrintWriter out=response.getWriter();
com.example.person p=new com.example.person();
com.example.Dog dog=new com.example.Dog();
RequestDispatcher view=request.getRequestDispatcher("final.jsp");

3rd file (
package com.example;
public class Dog{
static String name;
public static String getName(){
return name;
public void setName(String name){;

last file(final.jsp)
<h1>The Name Is:</h1>

her eits giving the error.

The directory com is under web-apps,app-name,classes.

web.xml for your ref is :

<web-app xml=""

[ April 01, 2005: Message edited by: S javainn ]
[ April 02, 2005: Message edited by: S javainn ]
Jose Esteban
Ranch Hand

Joined: Nov 28, 2004
Posts: 102
The person class is missing in your post.
Bassam Zahid
Ranch Hand

Joined: Mar 09, 2005
Posts: 61
Please note that "Dog" object is not placed in your "Person" bean. What you are doing is just setting it as an attribute. Try accessing the "Dog" object through scriptlets. Also declare the "Dog" object in the person class as an instance member then you could use the above posted EL code.


BS<br />SCJP 1.4 88%<br />SCWCD 1.4 86%
trivikram Kumar
Ranch Hand

Joined: Feb 21, 2005
Posts: 172
Sorry....pals..this is my persons class
Hi Bassam,
I declared that i forgot to post the person class.
Can you please check it now and let me know where the problem is...
here is my persons class

package com.example;

public class person{
private String name;
public static Dog dog=null;

public String getName(){
return name;
public void setName(String name){;
public static Dog getDog(){
return dog;
public void setDog(Dog dog){;
[ April 01, 2005: Message edited by: S javainn ]
It is sorta covered in the JavaRanch Style Guide.
subject: EL usage
Similar Threads
What needs to be done to display EL expression
Url problem
Jstl and EL
problems with EL in jsp and java bean
How to run simple JSTL page?