Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EL in WSAD not working

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Tina Jain
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
no wonder he is so sad, he hasn't seen this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic