Skip to content

Commit

Permalink
Issue 23914 - jsp:plugin noop, which removes ieClassId
Browse files Browse the repository at this point in the history
Signed-off-by: Arjan Tijms <arjan.tijms@gmail.com>
  • Loading branch information
arjantijms committed Apr 27, 2022
1 parent 8205400 commit 2b1eda2
Show file tree
Hide file tree
Showing 10 changed files with 3 additions and 92 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,6 @@
<!-- (separate from the JVM that the application -->
<!-- server is running in). [true] -->
<!-- -->
<!-- ieClassId The class-id value to be sent to Internet -->
<!-- Explorer when using <jsp:plugin> tags. -->
<!-- [clsid:8AD9C840-044E-11D1-B3E9-00805F499D93] -->
<!-- -->
<!-- javaEncoding Java file encoding to use for generating java -->
<!-- source files. [UTF8] -->
<!-- -->
Expand Down
2 changes: 1 addition & 1 deletion appserver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@

<!-- Jakarta Pages -->
<jakarta.pages-api.version>3.1.0</jakarta.pages-api.version>
<wasp.version>3.1.0-M2</wasp.version>
<wasp.version>3.1.0-M3</wasp.version>

<!-- Used for Jakarta SOAP (XML Web Services) -->
<xmlsec.version>2.3.0</xmlsec.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
* Unit test for Bugtraq 5027440 ("Impossible for webapp to override global
* JspServlet settings").
*
* Note that for test "jsp-servlet-override-ieClassId" to work, JSP
* precompilation must be turned off (see build.properties in this directory),
* so that the value of the 'ieClassId' property is gotten from the JspServlet
* (instead of from the JspC command line).
*/
public class WebTest {

Expand All @@ -50,7 +46,6 @@ public static void main(String[] args) {
stat.addDescription("Unit test for Bugtraq 5027440");
WebTest webTest = new WebTest(args);
try {
webTest.overrideIeClassId();
webTest.jspInclude();
stat.addStatus(TEST_NAME, stat.PASS);
} catch (Exception ex) {
Expand All @@ -62,52 +57,6 @@ public static void main(String[] args) {
stat.printSummary();
}

private void overrideIeClassId() throws Exception {
URL url = new URL("http://" + host + ":" + port +
contextRoot + "/jsp/overrideIeClassId.jsp");
System.out.println("Connecting to: " + url.toString());
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.connect();
int responseCode = conn.getResponseCode();
if (responseCode != 200) {
throw new Exception("Wrong response code. Expected: 200" +
", received: " + responseCode);
}

BufferedReader br = null;
try {
br = new BufferedReader(new InputStreamReader(
conn.getInputStream()));
String line = null;
while ((line = br.readLine()) != null) {
if (line.startsWith("<OBJECT")) {
break;
}
}

if (line != null) {
// Check <OBJECT> classid comment
System.out.println(line);
String classid = getAttributeValue(line, "classid");
if (classid != null) {
if (!classid.equals(OBJECT_CLASSID)) {
throw new Exception("Wrong classid: " + classid +
", expected: " + OBJECT_CLASSID);
}
} else {
throw new Exception("Missing classid");
}

} else {
throw new Exception("Missing OBJECT element in response body");
}
} finally {
try {
if (br != null) br.close();
} catch (IOException ex) {}
}
}

private void jspInclude() throws Exception {
URL url = new URL("http://" + host + ":" + port +
contextRoot + "/jsp/include.jsp");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>org.glassfish.wasp.servlet.JspServlet</servlet-class>
<init-param>
<param-name>ieClassId</param-name>
<param-value>ABCD</param-value>
</init-param>
</servlet>

</web-app>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,6 @@
<!-- (separate from the JVM that the application -->
<!-- server is running in). [true] -->
<!-- -->
<!-- ieClassId The class-id value to be sent to Internet -->
<!-- Explorer when using <jsp:plugin> tags. -->
<!-- [clsid:8AD9C840-044E-11D1-B3E9-00805F499D93] -->
<!-- -->
<!-- javaEncoding Java file encoding to use for generating java -->
<!-- source files. [UTF8] -->
<!-- -->
Expand Down
2 changes: 2 additions & 0 deletions appserver/tests/tck/tck-download/jakarta-pages-tck/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
</execution>
</executions>
<configuration>
<skipCache>true</skipCache>
<overwrite>true</overwrite>
<url>${tck.test.pages.url}</url>
<unpack>false</unpack>
<outputDirectory>${project.build.directory}</outputDirectory>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,6 @@
<!-- (separate from the JVM that the application -->
<!-- server is running in). [true] -->
<!-- -->
<!-- ieClassId The class-id value to be sent to Internet -->
<!-- Explorer when using <jsp:plugin> tags. -->
<!-- [clsid:8AD9C840-044E-11D1-B3E9-00805F499D93] -->
<!-- -->
<!-- javaEncoding Java file encoding to use for generating java -->
<!-- source files. [UTF8] -->
<!-- -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,6 @@ private static void configureJspc(JspC jspc, String pName, String pValue) {
jspc.setClassDebugInfo(Boolean.valueOf(pValue).booleanValue());
} else if ("enablePooling".equals(pName)) {
jspc.setPoolingEnabled(Boolean.valueOf(pValue).booleanValue());
} else if ("ieClassId".equals(pName)) {
jspc.setIeClassId(pValue);
} else if ("trimSpaces".equals(pName)) {
jspc.setTrimSpaces(Boolean.valueOf(pValue).booleanValue());
} else if ("genStrAsCharArray".equals(pName)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5855,10 +5855,6 @@ as `char` arrays, which improves performance in some cases.
|`httpMethods` |`*` for all methods |Specifies a comma separated list of
HTTP methods supported by the `JspServlet`.

|`ieClassId` |`clsid:8AD9C840-``044E-11D1-B3E9-``00805F499D93`
|Specifies the Java plug-in COM class ID for Internet Explorer. Used by
the `<jsp:plugin>` tags.

|`ignoreJspFragmentErrors` |`false` |If set to `true`, instructs the
compiler to ignore any JSP precompilation errors pertaining to
statically included JSP segments that, despite not being top level JSP
Expand Down

0 comments on commit 2b1eda2

Please sign in to comment.