how to write my first jsp file and compile and run it correctly

that is my first jsp file

I get this error message  with code number 500
type Exception report
description The server encountered an internal error () that prevented it from fulfilling this request.


org.apache.jasper.JasperException: /firstjsp.jsp(9,0) According to TLD or attribute directive in tag file, attribute value does not accept any expressions

note The full stack trace of the root cause is available in the Apache Tomcat/5.5.27 logs.
Apache Tomcat/5.5.27

please help me get it run and compile
best regards
hatem gamal
<%-- use the 'taglib' directive to make the JSTL 1.0 core tags available --%>
<%@ taglib uri="" prefix="c" %>
<%-- use the 'jsp:useBean' standard action to make the Date object available in page scope --%>
<jsp:useBean id="date" class="java.util.Date" />
<head><title>First JSP</title></head>
<h2>Here is today's date</h2>
<c:out value="Date: ${date}" />

Open in new window

Who is Participating?
rrzConnect With a Mentor Commented:
>can you tell me how to configure the deployment descriptor so that it runs  
If you are  using  
aren't you using the pre-installed web app jsp-examples ? If so the deployment descriptor is already there look at  
>I tried it and no good
Same error ?  
Did you try my solution.
Date: ${date}    
Anyway here is something we missed yesterday.  If you are using JSTL 1.1 then replace
<%@ taglib uri="" prefix="c" %>  
<%@taglib uri="" prefix="c"%>
Murali MurugesanFull stack Java developerCommented:

<c:out value="Date: ${date}" /> - this is the line having problem , change as below

Date:<c:out value="${date}" />


><c:out value="Date: ${date}" />  
Murili is correct, but since you are using Tomcat 5.5 and Servlet 2.4 API, you could also  just use    
Date: ${date}    
hatem_from_mesrAuthor Commented:
>>>Date:<c:out value="${date}" />
I tried it and no good
I heard something about deployment descriptor
can you tell me how to configure the deployment descriptor so that it runs
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.