Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!

Matt Newboult

+ Follow
since Feb 08, 2007
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Matt Newboult


I've read all of the forums but I'm stuck trying to use Filters to intercept a struts .do action using OC4J. I'm trying to intercept it to turn the html into a pdf. The filter is setup and working ok, but the code breaks when trying to get the CharResponseWrapper.

public final void doFilter(
final ServletRequest request,
final ServletResponse response,
final FilterChain chain) throws IOException, ServletException {

if (request instanceof HttpServletRequest) {
HttpServletRequest httpReq = (HttpServletRequest) request;
HttpServletResponse httpResp = (HttpServletResponse) response;

CharResponseWrapper wrapper = new CharResponseWrapper(httpResp);

System.out.println("*** wrapper: |" + wrapper.toString() + "|");
chain.doFilter(request, wrapper);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {

DocumentBuilder builder = DocumentBuilderFactory
Document doc = builder.parse(new InputSource(
new StringReader(wrapper.toString())));


The wrapper.toString() is empty! The CharResponseWrapper is the same as everyone else is using so can't see there being any problems there.

The exception is...

oracle.xml.parser.v2.XMLParseException: Start of root element expected.
at oracle.xml.parser.v2.XMLError.flushErrors1(
at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(
at oracle.xml.parser.v2.NonValidatingParser.parseDocument(
at oracle.xml.parser.v2.XMLParser.parse(
at oracle.xml.jaxp.JXDocumentBuilder.parse(

Any help, greatly appreciated.

13 years ago
I have an unusual problem that I'm struggling to get help with. We have a website with a login procedure and another site would like to access the site (from theirs) without having to logon. They want it to appear seamless. To do that they want to provide a hyperlink with the user and password in it as url parameters. Their site runs with ASP over IIS and ours using J2EE running OC4J (Oracle J2EE). Does anyone know of any good resources to look at to solve this?

I'm looking for something that will allow their ASP developers to encrypt a string so that I can decrypt it using J2EE. I've found Java->Java versions, but am looking for something that will work across these two platforms.

Any comments appreciated.
[ February 08, 2007: Message edited by: Matt Newboult ]
14 years ago