You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Michael Wentzel <Mi...@aswethink.com> on 2001/02/02 14:54:11 UTC

RE: date

> in jsp how i get the date for print in web in the format XX-XX-XX?

Works just like any other java class:

java.util.GregorianCalendar cal    = new GregorianCalendar();
java.text.SimpleDateFormat  format = new SimpleDateFormat("mm-dd-yy");
String s = format(cal.getTime());

---
Michael Wentzel
Software Developer
<A HREF="http://www.aswethink.com">Software As We Think</A>
<A HREF="mailto:wentzel@aswethink.com">Michael Wentzel</A>

RE: Web Application -- Netscape speed problem

Posted by Stefan Langer <ma...@gmx.de>.
The issue is the building of the page.
IE starts rendering pages while data is coming in and updates it as more data is available. Netscape version(4.x) needs to load the data first before it can display it. (At least for certain html structures like tables and images without width height attributes, etc...)
The problem you are experience is not one of your application but of the browser. Try using netscape 6 and see if it is faster. It should since the gecko engine is faster in rendering html pages than the engine used in netscape 4.7. 

Stefan


Web Application -- Netscape speed problem

Posted by venkatesan <gv...@aitpl.stpn.soft.net>.
Hi All,
        I have done codig for dynamically generated html pages using
servlets-tomacat-Rmi through Apach web server.. I am getting data for  html
pages from Sql-server which is in windows machine... And my servlets-tomcat
is in Linux machine which is running through Apache web server......
      The problem is while i am invoking html pages through IE it is too
past, the data comes as if it from local machine......But if i do the same
thing through Netscape Communicator(v4.7) browser, it takes lots of time to
load another  html page and speed is very very slow.... Can any one tell
that how can i get the html pages as fast as IE... and what is the exact
problem....

       Thanx in advance.....


Cheers
Venkatesh...










Re: date

Posted by Carlos <li...@lpis.com>.
if i put that in a jsp page appears the next error: how can i get the date?
thanks
Error: 500
Localizacion: /fecha.jsp
Error interno del servlet:

org.apache.jasper.JasperException: No se puede compilar la clase para
JSP/opt/jakarta/work/www.opticagaldakao.com_8080/_0002ffecha_0002ejspfecha_j
sp_0.java:58: Undefined variable or class name: java
                java.text.SimpleDateFormat  format = java.text.new
                                                     ^
/opt/jakarta/work/www.opticagaldakao.com_8080/_0002ffecha_0002ejspfecha_jsp_
0.java:59: Class SimpleDateFormat not found.
                SimpleDateFormat("mm-dd-yy");
                ^
/opt/jakarta/work/www.opticagaldakao.com_8080/_0002ffecha_0002ejspfecha_jsp_
0.java:60: Reference to variable format in class
_0002ffecha_0002ejspfecha_jsp_0 as if it were a method.
                String s = format(cal.getTime());
                                 ^
3 errors

	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:254)
	at org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:462)
	at
org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
	at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:433)
	at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspSe
rvlet.java:152)
	at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:164)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
	at org.apache.tomcat.core.Handler.service(Handler.java:286)
	at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
	at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
	at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
	at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:210)
	at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
	at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
	at java.lang.Thread.run(Thread.java:484)



----- Original Message -----
From: "CPC Livelink Admin" <cp...@fitzpatrick.cc>
To: <to...@jakarta.apache.org>
Sent: Friday, February 02, 2001 4:36 PM
Subject: RE: date


>
> What is the error message? It could be that if you did not import
> java.util.* and java.text.*, then it can't find the classes listed after
the
> 'new'.  Try it like this :
> <%
> java.util.GregorianCalendar cal    = new java.util.GregorianCalendar();
> java.text.SimpleDateFormat  format = java.text.new
> SimpleDateFormat("mm-dd-yy");
> String s = format(cal.getTime());
> %>
> <html><body>
>
> <%
> out.println(s);
>
> %>
> </body></html>
> -----Original Message-----
> From: Carlos [mailto:linux@lpis.com]
> Sent: Friday, February 02, 2001 10:11 AM
> To: tomcat-user@jakarta.apache.org
> Subject: Re: date
>
>
> in a jsp page i have put the next but doesn't run: Why?
> <%
> java.util.GregorianCalendar cal    = new GregorianCalendar();
> java.text.SimpleDateFormat  format = new SimpleDateFormat("mm-dd-yy");
> String s = format(cal.getTime());
> %>
> <html><body>
>
> <%
> out.println(s);
>
> %>
> </body></html>
>
>
> thanks
> Carlos
>
> ----- Original Message -----
> From: "Michael Wentzel" <Mi...@aswethink.com>
> To: <to...@jakarta.apache.org>
> Sent: Friday, February 02, 2001 2:54 PM
> Subject: RE: date
>
>
> > > in jsp how i get the date for print in web in the format XX-XX-XX?
> >
> > Works just like any other java class:
> >
> > java.util.GregorianCalendar cal    = new GregorianCalendar();
> > java.text.SimpleDateFormat  format = new SimpleDateFormat("mm-dd-yy");
> > String s = format(cal.getTime());
> >
> > ---
> > Michael Wentzel
> > Software Developer
> > <A HREF="http://www.aswethink.com">Software As We Think</A>
> > <A HREF="mailto:wentzel@aswethink.com">Michael Wentzel</A>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, email: tomcat-user-help@jakarta.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, email: tomcat-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, email: tomcat-user-help@jakarta.apache.org
>
>


RE: date

Posted by CPC Livelink Admin <cp...@fitzpatrick.cc>.
What is the error message? It could be that if you did not import
java.util.* and java.text.*, then it can't find the classes listed after the
'new'.  Try it like this :
<%
java.util.GregorianCalendar cal    = new java.util.GregorianCalendar();
java.text.SimpleDateFormat  format = java.text.new
SimpleDateFormat("mm-dd-yy");
String s = format(cal.getTime());
%>
<html><body>

<%
out.println(s);

%>
</body></html>
-----Original Message-----
From: Carlos [mailto:linux@lpis.com]
Sent: Friday, February 02, 2001 10:11 AM
To: tomcat-user@jakarta.apache.org
Subject: Re: date


in a jsp page i have put the next but doesn't run: Why?
<%
java.util.GregorianCalendar cal    = new GregorianCalendar();
java.text.SimpleDateFormat  format = new SimpleDateFormat("mm-dd-yy");
String s = format(cal.getTime());
%>
<html><body>

<%
out.println(s);

%>
</body></html>


thanks
Carlos

----- Original Message -----
From: "Michael Wentzel" <Mi...@aswethink.com>
To: <to...@jakarta.apache.org>
Sent: Friday, February 02, 2001 2:54 PM
Subject: RE: date


> > in jsp how i get the date for print in web in the format XX-XX-XX?
>
> Works just like any other java class:
>
> java.util.GregorianCalendar cal    = new GregorianCalendar();
> java.text.SimpleDateFormat  format = new SimpleDateFormat("mm-dd-yy");
> String s = format(cal.getTime());
>
> ---
> Michael Wentzel
> Software Developer
> <A HREF="http://www.aswethink.com">Software As We Think</A>
> <A HREF="mailto:wentzel@aswethink.com">Michael Wentzel</A>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, email: tomcat-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, email: tomcat-user-help@jakarta.apache.org



Re: date

Posted by Carlos <li...@lpis.com>.
in a jsp page i have put the next but doesn't run: Why?
<%
java.util.GregorianCalendar cal    = new GregorianCalendar();
java.text.SimpleDateFormat  format = new SimpleDateFormat("mm-dd-yy");
String s = format(cal.getTime());
%>
<html><body>

<%
out.println(s);

%>
</body></html>


thanks
Carlos

----- Original Message ----- 
From: "Michael Wentzel" <Mi...@aswethink.com>
To: <to...@jakarta.apache.org>
Sent: Friday, February 02, 2001 2:54 PM
Subject: RE: date


> > in jsp how i get the date for print in web in the format XX-XX-XX?
> 
> Works just like any other java class:
> 
> java.util.GregorianCalendar cal    = new GregorianCalendar();
> java.text.SimpleDateFormat  format = new SimpleDateFormat("mm-dd-yy");
> String s = format(cal.getTime());
> 
> ---
> Michael Wentzel
> Software Developer
> <A HREF="http://www.aswethink.com">Software As We Think</A>
> <A HREF="mailto:wentzel@aswethink.com">Michael Wentzel</A>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, email: tomcat-user-help@jakarta.apache.org
> 
>