Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to display RAW jsp in JSP page?

 
udhayan kumar
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I am currently writing a tutorial section for JSP and servlets. I am using Google App Engine as my infra structure.

I want to display the JSP programs in my tutorial section such that those programs should not be processed by the server.

For ex:

I want to display the below JSP program in my example1.jsp program. When I ran the jsp I got the error stating tat "Page directive must not have multiple occurrences of pageencoding" as I have two page directives one for my example1.jsp and another for the below code snippet.

*************************
<%@ page language="java" c
ontentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1" import="com.samples.PageDirective"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>JSP Directives</title>
</head>
<body>
Page Directive tag is used to import packages, enable/disable session, set or redirect to error page etc.,<br/>
Here I'm showing how to import a class and access a method from that class! <br/>
<%PageDirective objPD=new PageDirective();%>
<%=objPD.sayHello("Tim") %>
</body>
</html>
************************

Please help me how can i display it as I am bit new to JSP..

Your help is much appreciated!

Thanks in advance.

Regards,
Udhay
 
olivier dutranoit
Ranch Hand
Posts: 81
IBM DB2 Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try changing your

that should be enough i think...
it should be ignored by jsp and shown good in html
 
udhayan kumar
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
olivier dutranoit wrote:try changing your

that should be enough i think...
it should be ignored by jsp and shown good in html


Thank you...

Tats working..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic