You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Sjoerd van Leent <sv...@wanadoo.nl> on 2003/08/16 17:04:04 UTC

RE: How to trigger events from tomcat?

It seems the best way to do it is in a process or a thread, running
aside the regular web-application. This indeed uses an infinite loop to
check on times. You should be able to set this process as a low-priority
process, so it doesn't consume too much processor time.

I don't know if there is anything like a Timer in Java which you could
use, where it triggers on a timer interrupt. This should make it even
more lightweight.

Regards,
Sjoerd

-----Original Message-----
From: Prince [mailto:thelastprince@hotmail.com] 
Sent: donderdag 25 juli 2002 16:41
To: Tomcat Users List
Subject: How to trigger events from tomcat?

hi,

I am developing a web based appointment sheduler. the data is stored in
xml format.  i am using tomcat/jsp/servlet

for example if i added a new appointment , the program will ask for  a
reminder time. I am giving 08/08/2003 10:30
 so at 08/08/2003 10:30 an email should be sent to me saying that u have
an appointment.

how can i trigger for appointments. ie some method should be ther to
check if the appointment time is due on each second. Can i put an
infinite loop some how?

thanks n  regds
Prince



JSP 2.0 XML Syntax Problem

Posted by Sjoerd van Leent <sv...@wanadoo.nl>.
I am using the JSP 1.2 XML Syntax with the following page:

<?xml version="1.0" encoding="ISO-8859-1"?>

<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
          xmlns:c="http://java.sun.com/jstl/core_rt"
          version="1.2">

	<jsp:directive.page language="java" 
	                    contentType="text/html; charset=ISO-8859-1"
	                    pageEncoding="ISO-8859-1" 
	                    session="true" />

	<jsp:text><![CDATA[<?xml version="1.0" encoding="ISO-8859-1"
?>]]></jsp:text>
	<jsp:text><![CDATA[
		<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

		"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
	]]></jsp:text>

	<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
lang="en">
		<head>
			<title>Test2</title>
		</head>
		<body>
			<div>
				<c:forEach var="counter" begin="0"
end="9" step="1">
					${counter}
				</c:forEach>
			</div>
		</body>

	</html>
	
</jsp:root>

Doing this I get the following Tomcat/SAX error:

java.lang.NullPointerException
	
org.apache.jasper.compiler.PageInfo.popPrefixMapping(PageInfo.java:339)
	
org.apache.jasper.compiler.JspDocumentParser.endPrefixMapping(JspDocumen
tParser.java:574)
	
org.apache.xerces.parsers.AbstractSAXParser.endNamespaceMapping(Unknown
Source)
	org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown
Source)
	
org.apache.xerces.impl.XMLNamespaceBinder.handleEndElement(Unknown
Source)
	org.apache.xerces.impl.XMLNamespaceBinder.endElement(Unknown
Source)
	
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unk
nown Source)
	
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis
patcher.dispatch(Unknown Source)
	
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unkno
wn Source)
	org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
	org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
	org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
	javax.xml.parsers.SAXParser.parse(Unknown Source)
	
org.apache.jasper.compiler.JspDocumentParser.parse(JspDocumentParser.jav
a:195)
	
org.apache.jasper.compiler.ParserController.parse(ParserController.java:
223)
	
org.apache.jasper.compiler.ParserController.parse(ParserController.java:
146)
	
org.apache.jasper.compiler.ParserController.parse(ParserController.java:
132)
	
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:245)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:453)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
	
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.ja
va:555)
	
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:300)
	
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:293)
	
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

I need to use the core library, web.xml is filled correctly, I have
tested it with a old JSP syntax version. I think the problem is in the
xmlns:c="...", however, this should be good according to the JSP 1.2 XML
Syntax reference, so what am I doing wrong?

Please help,
Sjoerd van Leent



JSP 2.0 XML Syntax Problem

Posted by Sjoerd van Leent <sv...@wanadoo.nl>.
I am using the JSP 1.2 XML Syntax with the following page:

<?xml version="1.0" encoding="ISO-8859-1"?>

<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
          xmlns:c="http://java.sun.com/jstl/core_rt"
          version="1.2">

	<jsp:directive.page language="java" 
	                    contentType="text/html; charset=ISO-8859-1"
	                    pageEncoding="ISO-8859-1" 
	                    session="true" />

	<jsp:text><![CDATA[<?xml version="1.0" encoding="ISO-8859-1"
?>]]></jsp:text>
	<jsp:text><![CDATA[
		<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

		"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
	]]></jsp:text>

	<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
lang="en">
		<head>
			<title>Test2</title>
		</head>
		<body>
			<div>
				<c:forEach var="counter" begin="0"
end="9" step="1">
					${counter}
				</c:forEach>
			</div>
		</body>

	</html>
	
</jsp:root>

Doing this I get the following Tomcat/SAX error:

java.lang.NullPointerException
	
org.apache.jasper.compiler.PageInfo.popPrefixMapping(PageInfo.java:339)
	
org.apache.jasper.compiler.JspDocumentParser.endPrefixMapping(JspDocumen
tParser.java:574)
	
org.apache.xerces.parsers.AbstractSAXParser.endNamespaceMapping(Unknown
Source)
	org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown
Source)
	
org.apache.xerces.impl.XMLNamespaceBinder.handleEndElement(Unknown
Source)
	org.apache.xerces.impl.XMLNamespaceBinder.endElement(Unknown
Source)
	
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unk
nown Source)
	
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis
patcher.dispatch(Unknown Source)
	
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unkno
wn Source)
	org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
	org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
	org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
	javax.xml.parsers.SAXParser.parse(Unknown Source)
	
org.apache.jasper.compiler.JspDocumentParser.parse(JspDocumentParser.jav
a:195)
	
org.apache.jasper.compiler.ParserController.parse(ParserController.java:
223)
	
org.apache.jasper.compiler.ParserController.parse(ParserController.java:
146)
	
org.apache.jasper.compiler.ParserController.parse(ParserController.java:
132)
	
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:245)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:453)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
	
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.ja
va:555)
	
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:300)
	
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:293)
	
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

I need to use the core library, web.xml is filled correctly, I have
tested it with a old JSP syntax version. I think the problem is in the
xmlns:c="...", however, this should be good according to the JSP 1.2 XML
Syntax reference, so what am I doing wrong?

Please help,
Sjoerd van Leent



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


RE: Tomcat 5 and well-formed XHTML

Posted by Sjoerd van Leent <sv...@wanadoo.nl>.
OK I'm baffeled, I did use:

<jsp:directive.page language="java" 
                    contentType="text/html ; charset=ISO-8859-1"
                    pageEncoding="ISO-8859-1" />

But reading the example it says that the ";" sign between text/html and
charset must contain no spaces at the front, so you'll get:

<jsp:directive.page language="java" 
                    contentType="text/html; charset=ISO-8859-1"
                    pageEncoding="ISO-8859-1" />

Why always such a stupidity?

Sjoerd van Leent

-----Original Message-----
From: Graham Stark [mailto:graham.stark@virtual-worlds.biz] 
Sent: zondag 17 augustus 2003 23:45
To: Tomcat Users List
Subject: Re: Tomcat 5 and well-formed XHTML

Sjoerd,

I had the selfsame problem last week. The solution (thanks to Bill
Barker) is to add:

<jsp:directive.page contentType="text/html; charset=iso-8859-1" /> 

to the page.

Graham

> I want to run this code on tomcat 5, on port 8080 in Internet
Explorer,
> but something strange happens:
> 
> When I run the following code
> 
> ::: CODE :::
> 
> <?xml version="1.0" encoding="ISO-8859-1" ?>
> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2">
> 
> <jsp:directive.page language="java" 
>                     contentType="text/html ; charset=ISO-8859-1"
>                     pageEncoding="ISO-8859-1" />
> 
> 	<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
> lang="en">
> 		<head>
> 			<title>Test2</title>
> 		</head>
> 		<body>
> 			<div>
> 				Test2
> 			</div>
> 		</body>
> 
> 	</html>
> 	
> </jsp:root>
> 
> ::: END CODE :::
> 
> You will expect a nice XHTML page from it. In Netscape and Mozilla it
is
> exactly this, but when running in IE6, I get a XML-tree instead of a
> page, which I expected.
> 
> Also when I look at the properties, I note a strange value, the Type
> value of the page contains "JavaServer Page", which shouldn't be
filled
> at all. So how can I change this, so I get IE6 working?
> 
> Thanks in advance,
> Sjoerd van Leent
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
-- 
Graham Stark, Virtual Worlds
phone: (+044) 01908 618239 mobile: 07952 633185
Homepage http://www.virtual-worlds.biz
Virtual Learning Arcade http://www.bized.ac.uk/virtual/vla
Virtual Economy http://www.bized.ac.uk/virtual/economy         


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





RE: Tomcat 5 and well-formed XHTML

Posted by Sjoerd van Leent <sv...@wanadoo.nl>.
OK I'm baffeled, I did use:

<jsp:directive.page language="java" 
                    contentType="text/html ; charset=ISO-8859-1"
                    pageEncoding="ISO-8859-1" />

But reading the example it says that the ";" sign between text/html and
charset must contain no spaces at the front, so you'll get:

<jsp:directive.page language="java" 
                    contentType="text/html; charset=ISO-8859-1"
                    pageEncoding="ISO-8859-1" />

Why always such a stupidity?

Sjoerd van Leent

-----Original Message-----
From: Graham Stark [mailto:graham.stark@virtual-worlds.biz] 
Sent: zondag 17 augustus 2003 23:45
To: Tomcat Users List
Subject: Re: Tomcat 5 and well-formed XHTML

Sjoerd,

I had the selfsame problem last week. The solution (thanks to Bill
Barker) is to add:

<jsp:directive.page contentType="text/html; charset=iso-8859-1" /> 

to the page.

Graham

> I want to run this code on tomcat 5, on port 8080 in Internet
Explorer,
> but something strange happens:
> 
> When I run the following code
> 
> ::: CODE :::
> 
> <?xml version="1.0" encoding="ISO-8859-1" ?>
> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2">
> 
> <jsp:directive.page language="java" 
>                     contentType="text/html ; charset=ISO-8859-1"
>                     pageEncoding="ISO-8859-1" />
> 
> 	<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
> lang="en">
> 		<head>
> 			<title>Test2</title>
> 		</head>
> 		<body>
> 			<div>
> 				Test2
> 			</div>
> 		</body>
> 
> 	</html>
> 	
> </jsp:root>
> 
> ::: END CODE :::
> 
> You will expect a nice XHTML page from it. In Netscape and Mozilla it
is
> exactly this, but when running in IE6, I get a XML-tree instead of a
> page, which I expected.
> 
> Also when I look at the properties, I note a strange value, the Type
> value of the page contains "JavaServer Page", which shouldn't be
filled
> at all. So how can I change this, so I get IE6 working?
> 
> Thanks in advance,
> Sjoerd van Leent
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
-- 
Graham Stark, Virtual Worlds
phone: (+044) 01908 618239 mobile: 07952 633185
Homepage http://www.virtual-worlds.biz
Virtual Learning Arcade http://www.bized.ac.uk/virtual/vla
Virtual Economy http://www.bized.ac.uk/virtual/economy         


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





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


Re: Tomcat 5 and well-formed XHTML

Posted by Graham Stark <gr...@virtual-worlds.biz>.
Sjoerd,

I had the selfsame problem last week. The solution (thanks to Bill
Barker) is to add:

<jsp:directive.page contentType="text/html; charset=iso-8859-1" /> 

to the page.

Graham

> I want to run this code on tomcat 5, on port 8080 in Internet Explorer,
> but something strange happens:
> 
> When I run the following code
> 
> ::: CODE :::
> 
> <?xml version="1.0" encoding="ISO-8859-1" ?>
> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2">
> 
> <jsp:directive.page language="java" 
>                     contentType="text/html ; charset=ISO-8859-1"
>                     pageEncoding="ISO-8859-1" />
> 
> 	<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
> lang="en">
> 		<head>
> 			<title>Test2</title>
> 		</head>
> 		<body>
> 			<div>
> 				Test2
> 			</div>
> 		</body>
> 
> 	</html>
> 	
> </jsp:root>
> 
> ::: END CODE :::
> 
> You will expect a nice XHTML page from it. In Netscape and Mozilla it is
> exactly this, but when running in IE6, I get a XML-tree instead of a
> page, which I expected.
> 
> Also when I look at the properties, I note a strange value, the Type
> value of the page contains "JavaServer Page", which shouldn't be filled
> at all. So how can I change this, so I get IE6 working?
> 
> Thanks in advance,
> Sjoerd van Leent
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
-- 
Graham Stark, Virtual Worlds
phone: (+044) 01908 618239 mobile: 07952 633185
Homepage http://www.virtual-worlds.biz
Virtual Learning Arcade http://www.bized.ac.uk/virtual/vla
Virtual Economy http://www.bized.ac.uk/virtual/economy         


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


Re: Tomcat 5 and well-formed XHTML

Posted by Graham Stark <gr...@virtual-worlds.biz>.
Sjoerd,

I had the selfsame problem last week. The solution (thanks to Bill
Barker) is to add:

<jsp:directive.page contentType="text/html; charset=iso-8859-1" /> 

to the page.

Graham

> I want to run this code on tomcat 5, on port 8080 in Internet Explorer,
> but something strange happens:
> 
> When I run the following code
> 
> ::: CODE :::
> 
> <?xml version="1.0" encoding="ISO-8859-1" ?>
> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2">
> 
> <jsp:directive.page language="java" 
>                     contentType="text/html ; charset=ISO-8859-1"
>                     pageEncoding="ISO-8859-1" />
> 
> 	<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
> lang="en">
> 		<head>
> 			<title>Test2</title>
> 		</head>
> 		<body>
> 			<div>
> 				Test2
> 			</div>
> 		</body>
> 
> 	</html>
> 	
> </jsp:root>
> 
> ::: END CODE :::
> 
> You will expect a nice XHTML page from it. In Netscape and Mozilla it is
> exactly this, but when running in IE6, I get a XML-tree instead of a
> page, which I expected.
> 
> Also when I look at the properties, I note a strange value, the Type
> value of the page contains "JavaServer Page", which shouldn't be filled
> at all. So how can I change this, so I get IE6 working?
> 
> Thanks in advance,
> Sjoerd van Leent
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
-- 
Graham Stark, Virtual Worlds
phone: (+044) 01908 618239 mobile: 07952 633185
Homepage http://www.virtual-worlds.biz
Virtual Learning Arcade http://www.bized.ac.uk/virtual/vla
Virtual Economy http://www.bized.ac.uk/virtual/economy         


Tomcat 5 and well-formed XHTML

Posted by Sjoerd van Leent <sv...@wanadoo.nl>.
I want to run this code on tomcat 5, on port 8080 in Internet Explorer,
but something strange happens:

When I run the following code

::: CODE :::

<?xml version="1.0" encoding="ISO-8859-1" ?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2">

<jsp:directive.page language="java" 
                    contentType="text/html ; charset=ISO-8859-1"
                    pageEncoding="ISO-8859-1" />

	<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
lang="en">
		<head>
			<title>Test2</title>
		</head>
		<body>
			<div>
				Test2
			</div>
		</body>

	</html>
	
</jsp:root>

::: END CODE :::

You will expect a nice XHTML page from it. In Netscape and Mozilla it is
exactly this, but when running in IE6, I get a XML-tree instead of a
page, which I expected.

Also when I look at the properties, I note a strange value, the Type
value of the page contains "JavaServer Page", which shouldn't be filled
at all. So how can I change this, so I get IE6 working?

Thanks in advance,
Sjoerd van Leent



Tomcat 5 and well-formed XHTML

Posted by Sjoerd van Leent <sv...@wanadoo.nl>.
I want to run this code on tomcat 5, on port 8080 in Internet Explorer,
but something strange happens:

When I run the following code

::: CODE :::

<?xml version="1.0" encoding="ISO-8859-1" ?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2">

<jsp:directive.page language="java" 
                    contentType="text/html ; charset=ISO-8859-1"
                    pageEncoding="ISO-8859-1" />

	<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
lang="en">
		<head>
			<title>Test2</title>
		</head>
		<body>
			<div>
				Test2
			</div>
		</body>

	</html>
	
</jsp:root>

::: END CODE :::

You will expect a nice XHTML page from it. In Netscape and Mozilla it is
exactly this, but when running in IE6, I get a XML-tree instead of a
page, which I expected.

Also when I look at the properties, I note a strange value, the Type
value of the page contains "JavaServer Page", which shouldn't be filled
at all. So how can I change this, so I get IE6 working?

Thanks in advance,
Sjoerd van Leent



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