Hi all,
I've attached three slightly changed JSPs from struts-test. The changes
are needed for application servers that don't use cookie-based session
tracking. The original JSPs have been written in a way that they will
throw exceptions when executed w/o cookies.
>From my opinion, an application intended for test or demonstration
purposes should not throw exceptions, leaving newbies with the question
if they've not correctly installed Struts or their app server or - even
worse - struts is buggy.
The attached changes together with those in my next mail, should leave
only one open issue (bean:include) for users running struts on WLS5.1 SP8.
--
Matthias mailto:[EMAIL PROTECTED]
Title: Test struts-bean:cookie Tag
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
Test struts-bean:cookie Tag
Display the properties of our current session ID cookie
Property Name |
Correct Value |
Test Result |
comment |
|
|
domain |
|
|
maxAge |
|
|
name |
|
|
path |
|
|
secure |
|
|
value |
|
|
version |
|
|
Property Name |
Correct Value |
Test Result |
comment |
|
|
domain |
|
|
maxAge |
|
|
name |
|
|
path |
|
|
secure |
|
|
value |
|
|
version |
|
|
|
Title: Test struts-logic Match Tags
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
Test struts-logic Match Tags
<%
pageContext.setAttribute("string", "String test value");
%>
Test Type |
Variable Content |
Value Content |
Correct Value Test |
Test Result |
<%
// WLS sometimes confuses ...FromCookie and ...FromUrl
if (!request.isRequestedSessionIdFromCookie() || request.isRequestedSessionIdFromURL())
{
%>
Skipping cookie matching - enable cookies and/or turn off URLRewriting first |
<%
}
else {
%>
Cookie / Any |
|
0 |
contains |
match
notMatch
|
Cookie / End |
|
0 |
ends with |
match
notMatch
|
Cookie / Start |
|
0 |
starts with |
match
notMatch
|
<%
}
%>
Header / Any |
|
Mozilla |
contains |
match
notMatch
|
Header / End |
|
Mozilla |
ends with |
match
notMatch
|
Header / Start |
|
Mozilla |
starts with |
match
notMatch
|
Name / Any |
|
value |
contains |
match
notMatch
|
Name / End |
|
value |
ends with |
match
notMatch
|
Name / Start |
|
value |
starts with |
match
notMatch
|
Parameter / Any |
|
value1 |
contains |
match
notMatch
|
Parameter / End |
|
value1 |
ends with |
match
notMatch
|
Parameter / Start |
|
value1 |
starts with |
match
notMatch
|
Property / Any |
|
FOO |
contains |
match
notMatch
|
Property / End |
|
FOO |
ends with |
match
notMatch
|
Property / Start |
|
FOO |
starts with |
match
notMatch
|
|
Title: Test struts-logic Presence Tags
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
Test struts-logic Presence Tags
Test Type |
Correct Value |
Test Result |
Bean |
present |
present
notPresent
|
Bean |
notPresent |
present
notPresent
|
Cookie |
<%
// JSESSIONID is NOT always present.
if (!request.isRequestedSessionIdFromCookie() || request.isRequestedSessionIdFromURL())
{
%>
notPresent |
<%
}
else {
%>
present |
<%
}
%>
present
notPresent
|
Cookie |
notPresent |
present
notPresent
|
Header |
present |
present
notPresent
|
Header |
notPresent |
present
notPresent
|
Parameter |
present |
present
notPresent
|
Parameter |
notPresent |
present
notPresent
|
Property |
present |
present
notPresent
|
Property |
notPresent |
present
notPresent
|
|