Solved

Page directive

Posted on 2004-09-15
8
1,048 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
Industry Leaders: 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

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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
HTML5 vs JSP - REST based application development 4 1,358
IE doesn't Invoke servlet in iframe 1 123
Can't access image with tomcat/html 6 107
collection output issue 9 68
Original post  on Monitis Blog. Web performance monitoring is broken into two camps: passive and active. Passive monitoring is defined as looking at real-world historical performance by monitoring actual log-ins, site hits, clicks, requests for…
This article was initially published on Monitis Blog, you can read it here . When it comes to deciding which approach to website performance monitoring is best for your business, unfortunately, like so many options in life . . . it depends. In t…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

696 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