tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mufaddal Khumri <mufad...@wmotion.com>
Subject is there a tag or some kind of mechanism that would do the following ...
Date Tue, 25 Feb 2003 08:27:25 GMT
Hi,

Many times we come across a lot of out.println( ... ) statements in our 
servlets:

public class MyServlet extends ....
{
	....
	....

	doPost( ... )
	{
		.....
		.....
		out.println("<html>");
		out.println("<title>");
		out.println("ding dong bells");
		out.println("</title>");
		out.println("<body>");
		out.println("</body>");
		out.println("</html>");
		......
	}
}

I do know that if your code has more html .. its better to write a .jsp 
file instead of a servlet.java file
There are some cases where this is unavoidable and I was wondering if 
there was a way to do something like below in a .java file:

public class MyServlet extends ....
{
	....
	....

	doPost( ... )
	{
		.....
		.....

		<Some kind of tag that signals to the compiler that whatever follows 
is to be "out.println(... )" >
		
			<html>
			<title>
				ding dong bells
			</title>
			<body>
			</body>
			</html>
	
		</end of the signalling tag>
		......
	}
}


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


Mime
View raw message