javahtmljsp

Run .JSP file online


I am having a lot of difficulty trying to install a TomCat server so instead of wasting time, is there anyway I can run some java server page code online? I am very short on time and need to compile this code below and find out whats wrong. if someone can lead me to a website that can compile JSP online, that would be excellent! Thank you for the help

<HTML>
<HEAD>
<TITLE>JSP Debugging</TITLE>
</HEAD>

<BODY>
<% import java.io.*; %>
<% import java.util.Date; %>
<% import java.util.Enumeration; %>

<%
    response.setContentType("MIME");
    Date today = new Date(12,20,2004);

    Date created = new Date(session.getCreationTime());
    Date lastAccessed = new Date(session.getLastAccessedTime());

    out.print("<h1>Today is " );
    out.print(today); 
    out.print("</h1>" );
    out.print("This session has the following characteristics:<br>" );
    out.println("<br>ID: ");
    <%= session.getId(); %>
    out.println("Created: " + created);
    out.println("Last Accessed: " + lastAccessed);
    out.println("<br>Max Inactive Interval: " +
                    session.getMaxInactiveInterval());
%>
</BODY>
</HTML>

Solution

  • Download Netbeans(Java EE) with Glassfish server. You will not have to worry about installing anything else to make your code running

    Note: Make sure that you choose correct version and build that is compatible with your JDK installed

    Download Netbeans