Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Newbie Need Help :)

 
Sandra Ch
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My problem.
http://localhost:8080/examples/jsp/jsp1.jsp A HTTP 500 - Internal server error appeared in my browser.
What I did
0) JAVA2 SDK 1.3 installed
1) JSWDK1.0.1 was installed
2) Activated the StartServer
3) jsp1.jsp was placed in this directory :
D:\myServlet\jswdk-1.0.1\examples\jsp\jsp1.jsp
The codes (copy from example)
jsp1.jsp
<H1>Time JSP</H1>
<%
java.util.Date dt = new java,util.Date (
System.currentTimeMillis() );
%>
<%=dt.getHours()%>:<%>:<%=dt.getMinutes()%>:<%=dt.getSeconds()%>
May I know which part did I did wrong or missed?
Thanks in Advance!
Sandra
 
Peter Gragert
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is at least one typing error!
java,util.Date
^ must be a .!
But this is not the solution you look for.(newbie to jsp ;-) )
 
Sandra Ch
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the notes, but I have checked my codes, there is no comma found in "java.util.Date".
I am not sure does jsp need any special compileing before it can be excuted on the browser?
 
Peter Gragert
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This works:
<html><head><title>test</title></head>
<body>
<H1>Time JSP</H1>
<%
java.util.Date dt = new java.util.Date (
System.currentTimeMillis() );
%>
It is now:
<%=dt.getHours()%>:<%=dt.getMinutes()%>:<%=dt.getSeconds()%><br>
Peter was here!
</body>
Result:
--------------
Time JSP (in H1)
It is now: 8:53:44
Peter was here!
-----------------
I got problems by spaces in the commands, removing them solve problems.
The comma (wrong) is in your code here at the bulletin board,
maybe you edit it?
[This message has been edited by Peter Gragert (edited April 19, 2001).]
 
Sandra Ch
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh thank you! thank you, Peter!
I got my first JSP script running!!
*hugs*
 
Peter Gragert
Ranch Hand
Posts: 424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!
My first 'servlet' was too some great feeling. (Some days ago)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic