?
Solved

Page directive

Posted on 2004-09-15
8
Medium Priority
?
1,060 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 672 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 664 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 664 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

In this article, WatchGuard's Director of Security Strategy and Research Teri Radichel, takes a look at insider threats, the risk they can pose to your organization, and the best ways to defend against them.
Check out what's been happening in the Experts Exchange community.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

718 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