Solved

Page directive

Posted on 2004-09-15
8
1,051 Views
Last Modified: 2008-01-16
###########################testing.jsp#####################################
 /*
I try to put the following lines of codes into the testing.jsp however when i run them it returns me an error:

"Page directive: can't have multiple occurrences of language"

1. Where went wrong with my codes?
2. I'm running these jsp files on a desktop not wap so are my contentType correct?
   "contentType="text/vnd.wap.wml"%"

*/


<%@ include file="prologue.jsp" %>
<%@ page errorPage="errorPage.jsp"%>

###########################testing.jsp#####################################


#########################prologue.jsp#####################################


<%@ page language="java" contentType="text/html" import="java.sql.*,java.text.*,java.io.*, java.util.*,java.util.Date, javax.comm.*, api.*, modular.*, thread.*" session="true"%>

<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
      "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">


#########################prologue.jsp#####################################



#########################errorPage.jsp#####################################

<%@ include file="prologue.jsp" %>

<%@ page isErrorPage="true" language="java" contentType="text/vnd.wap.wml"%>

<head>
      <title>Error page</title>
</head>
<body>
<p> <font face="Arial, Helvetica, sans-serif">
  <%
      out.println("Error occurred: " + exception.toString() + " was raised");
      out.print("<br/>");
      out.print("<br/>");
      out.print("Please contact the administrator at 1234567");
      %>
  </font></p>
</body>
</html>
#########################errorPage.jsp#####################################


0
Comment
Question by:mwcmp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 35

Accepted Solution

by:
TimYates earned 168 total points
ID: 12063106
> <%@ page isErrorPage="true" language="java" contentType="text/vnd.wap.wml"%>

you specify "language" there as well as in prologue.jsp

change it to:

<%@ page isErrorPage="true" contentType="text/vnd.wap.wml"%>
0
 
LVL 35

Expert Comment

by:TimYates
ID: 12063116
and text/vnd.wap.wml is the correct mime-type for wml
0
 

Author Comment

by:mwcmp
ID: 12063363
re: and text/vnd.wap.wml is the correct mime-type for wml

but I'm not doing for wml, the jsp pages are to be run on the desktop/internet. So it is still ok?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 35

Expert Comment

by:TimYates
ID: 12063380
No, I'd remove it

Your prologue.jsp sets it to "text/html" anyway, so the second one will probably be ignored...
0
 
LVL 11

Assisted Solution

by:sompol_kiatkamolchai
sompol_kiatkamolchai earned 166 total points
ID: 12065979
all attributes in page directive can occur one times except for import attribute.
0
 
LVL 10

Assisted Solution

by:kupra1
kupra1 earned 166 total points
ID: 12238061
The error is coming due to the fact that you are including one jsp into another jsp. As the language attribute can be defined only once for one complete jsp page, it throws that error. So, you need to remove all the attributes like language="java" from all your include jsp pages as the parent jsp page already has that.
yep... It's a correct content-type.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Gain an elementary understanding of Blockchain technology.
Here's how to start interacting with our community through Post.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question