0

I am new to j-s-p, and I followed an tutorial to learn it, but the given example in that tutorial does not work in my browser, the browser just display the code i wrote but not the output.

I expected to see the current time on the browser, but I just see the code itself displayed.

I am using Fire-Fox.

j-s-p code:

<HTML>
<BODY>
 Hello!  The time is now <%= new java.util.Date() %>
</BODY>
</HTML>
Amr Bakri
  • 273
  • 3
  • 11

2 Answers2

1

Install Apache Tomcat or Glassfish server:

Once your server is up and and running the path to your index.jsp shoul be something like this:

http://localhost:8080/index.jsp

this should solve your problem

awsmketchup
  • 112
  • 2
  • 14
0

You need to run your JSP in a servlet container in order that the Java code is executed, e.g. Apache Tomcat.

The servlet container runs the java code on server side and sends the response to the client.

Since you wrote you just started learning JSP and web technologies, this question might also be helpful. It contains also some information about Servlets, JSPs and web containers and how they work together.

Community
  • 1
  • 1
Uooo
  • 6,204
  • 8
  • 36
  • 63