File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes EL in WSAD not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "EL in WSAD not working" Watch "EL in WSAD not working" New topic
Author

EL in WSAD not working

Tina Jain
Greenhorn

Joined: Mar 17, 2006
Posts: 23
Hello,

I am using the EL in WSAD 5.0 it is not displaying simple expression.

${carmake} where carmake is the attribute in the session.

I have the jar files in the lib by default.

if i am using this
<%= session.getAttribute("carmake") %>
it is working fine.

this is the jsp file.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<HTML>
<HEAD>
<%@ page
language="java"
contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"
%>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="IBM WebSphere Studio">
<META http-equiv="Content-Style-Type" content="text/css">
<LINK href="theme/Master.css" rel="stylesheet"
type="text/css">
<TITLE>test.jsp</TITLE>
</HEAD>
<BODY>
<P>Place content here.</P>

<p>
Make of the Car

${carmake}:
<BR><BR>
<%= session.getAttribute("carmake") %>
<BR>
<BR>
<BR>


</p>
</BODY>
</HTML>


This is my web.xml file.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app id="WebApp">
<display-name>ServetsJspFirst</display-name>
<servlet>
<servlet-name>GettingRequestResponse</servlet-name>
<display-name>GettingRequestResponse</display-name>
<servlet-class>com.gss.first.GettingRequestResponse</servlet-class>
<init-param>
<param-name>initnamea</param-name>
<param-value>initvaluea</param-value>
</init-param>
<init-param>
<param-name>initnameb</param-name>
<param-value>initvalueb</param-value>
</init-param>
</servlet>
<servlet>
<servlet-name>TestForwardRedirect</servlet-name>
<display-name>TestForwardRedirect</display-name>
<servlet-class>com.gss.first.TestForwardRedirect</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>GettingRequestResponse</servlet-name>
<url-pattern>/GettingRequestResponse</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>TestForwardRedirect</servlet-name>
<url-pattern>/TestForwardRedirect</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<taglib>
<taglib-uri>http://jakarta.apache.org/taglibs/application-1.0</taglib-uri>
<taglib-location>/WEB-INF/lib/taglibs-application.jar</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://jakarta.apache.org/taglibs/page-1.0</taglib-uri>
<taglib-location>/WEB-INF/lib/taglibs-page.jar</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://jakarta.apache.org/taglibs/request-1.0</taglib-uri>
<taglib-location>/WEB-INF/lib/taglibs-request.jar</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://jakarta.apache.org/taglibs/response-1.0</taglib-uri>
<taglib-location>/WEB-INF/lib/taglibs-response.jar</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://jakarta.apache.org/taglibs/session-1.0</taglib-uri>
<taglib-location>/WEB-INF/lib/taglibs-session.jar</taglib-location>
</taglib>
<taglib>
<taglib-uri>jspsql</taglib-uri>
<taglib-location>/WEB-INF/lib/jspsql.jar</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://jakarta.apache.org/taglibs/i18n-1.0</taglib-uri>
<taglib-location>/WEB-INF/lib/i18n.jar</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://jakarta.apache.org/taglibs/datetime-1.0</taglib-uri>
<taglib-location>/WEB-INF/lib/taglibs-datetime.jar</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://jakarta.apache.org/taglibs/string-1.0.1</taglib-uri>
<taglib-location>/WEB-INF/lib/taglibs-string.jar</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://jakarta.apache.org/taglibs/utility</taglib-uri>
<taglib-location>/WEB-INF/lib/utility.jar</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://jakarta.apache.org/taglibs/mailer-1.1</taglib-uri>
<taglib-location>/WEB-INF/lib/taglibs-mailer.jar</taglib-location>
</taglib>
</web-app>


Any hint will be of great help.
Thanks in advance.

[ September 29, 2006: Message edited by: Tina Jain ]
[ September 29, 2006: Message edited by: Tina Jain ]

If You Cannot Give Anything, At least Give A Smile.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61588
    
  67

Does WSAD 5.0 even support JSP 2.0 and Servlets 2.4?

If so, your web.xml is incorrectly using the Servlets 2.3 DOCTYPE rather than the Servlets 2.4 XML Schema.

If not, well, then you can't use the EL outside of the JSTL.
[ September 29, 2006: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Tina Jain
Greenhorn

Joined: Mar 17, 2006
Posts: 23
Thanks for your reply.

That helps a lot.

But is there any way I can use EL in IBM WebSphere Studio Enterprise Developer Version 5.1.2

WSAD 5.1.2 supports servlets 2.3
J2EE 1.3.

Adding some jar file in lib or by doing anything else.

Have a Nice Day,
Best Regards,
Tina
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61588
    
  67

If it supports Servlets 2.3 it probably supports JSP 1.2. If so, you can use the JSTL 1.0 (not 1.1 -- that's for JSP 2.0 only).

In JSP 1.2 and JSTL 1.0, you can use the EL only as attributes to JSTL tags, and you cannot use the EL in JSP template text.
[ September 30, 2006: Message edited by: Bear Bibeault ]
Tina Jain
Greenhorn

Joined: Mar 17, 2006
Posts: 23
Thank you so much for your help. I was going through some books that I had but I was not able to get the answer.

Your reply in which you stated

In JSP 1.2 and JSTL 1.0, you can use the EL only as attributes to JSTL tags, and you cannot use the EL in JSP template text.

Answer all of my questions.

Have a nice Day and Week
Best Regards,
Tina
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EL in WSAD not working