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
Solved

Page directive

Posted on 2004-09-15
8
1,045 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
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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

 
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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Suggested Solutions

Title # Comments Views Activity
attribute vs parameter and setter vs add method 17 89
J2SE 5.0 metadata 1 61
instanceof  operator in java 26 95
eclipse buid path vs tomcat lib path 10 34
If you are looking at this article, you have most likely been hit by some version of ransomware and are trying to find out if there is anything you can do, or what way you should react - READ ON!
The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with the aid of a graphical interface. Based on the inputs you provide, it generates images for deployment and creates reusable PowerShell scripts that …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

856 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