This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Servlets and the fly likes Newbie Need Help :) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Newbie Need Help :)" Watch "Newbie Need Help :)" New topic
Author

Newbie Need Help :)

Sandra Ch
Greenhorn

Joined: Apr 18, 2001
Posts: 4
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

Joined: Jan 16, 2001
Posts: 424
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

Joined: Apr 18, 2001
Posts: 4
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

Joined: Jan 16, 2001
Posts: 424
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

Joined: Apr 18, 2001
Posts: 4
Oh thank you! thank you, Peter!
I got my first JSP script running!!
*hugs*
Peter Gragert
Ranch Hand

Joined: Jan 16, 2001
Posts: 424
Thanks!
My first 'servlet' was too some great feeling. (Some days ago)
 
GeeCON Prague 2014
 
subject: Newbie Need Help :)