Solved

Page directive

Posted on 2004-09-15
8
1,035 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
Comment Utility
> <%@ 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
Comment Utility
and text/vnd.wap.wml is the correct mime-type for wml
0
 

Author Comment

by:mwcmp
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 35

Expert Comment

by:TimYates
Comment Utility
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
Comment Utility
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
Comment Utility
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Session migration 1 93
reflection example 3 79
oracle fusion vs MQ 2 91
eclipse luna javeEE perspecive missing 5 77
In this article, you will read about the trends across the human resources departments for the upcoming year. Some of them include improving employee experience, adopting new technologies, using HR software to its full extent, and integrating artifi…
In this article, I will show you HOW TO: Create your first Windows Virtual Machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, the Windows OS we will install is Windows Server 2016.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now