jsp page appears in xml tree format. how can i fix this?
Joe Marchi
Greenhorn
Joined: Apr 25, 2010
Posts: 11
posted
0
hello, im trying to run a simple example using JSP document using xml syntax but cannot display the content output as jsp. the page loads in xml tree format in the browser.
how do i display the content as jsp/html?
here is my html
it goes to a /searchcontroller.jsp file with the following code
public String getView() {
return "/emptysearch.jsp";
}
which forwards to this /emptysearch.jsp page
now when i enter the first html form it takes me to a page with xml tree for the above jsp instead of displaying it in jsp or html format. I have added the jsp:directive.page contentType="text/html; charset=ISO-8859-1" but it still doesnt display the page as a jsp..
Yeah, are you sure your container supports JSP XML (or whatever that's called)?
Joe Marchi
Greenhorn
Joined: Apr 25, 2010
Posts: 11
posted
0
I am using weblogic server 10.3. the page output is this:
---------------------------------------------------
This XML file does not appear to have any style information associated with it. The document tree is shown below.
−-----------------------------------------------
<html>
−
<head>
<title>Using Search Bean: no items found</title>
</head>
−
<body>
<h1>No items found</h1>
−
<form action="search">
−
<p>
Your search for "drege" returned no items. Try another search to find a match.
</p>
−
<p>
Search keywords:
<input type="text" size="30" name="keywords" value="drege"/>
</p>
<input value="Submit"/>
</form>
</body>
</html>
my web.xml looks like this:
my weblogic.xml looks like this
this example is out of the book j2ee applications and bea weblogic server second edition which would have probably worked for weblogic 8.1 but i am using weblogic 10.3.
not sure how to fix this!!!
Joe Marchi
Greenhorn
Joined: Apr 25, 2010
Posts: 11
posted
0
the weblogic container should display jsp documents for xml as its part of the jsp specification but something is not being flagged here or is not compatible ive tried to change the jsp:root version to 1.2 but i still get the same xml tree instead.
David Newton wrote:That's too bad, because now nobody else will know at least one thing to avoid.
+1
Joe Marchi
Greenhorn
Joined: Apr 25, 2010
Posts: 11
posted
0
out of respect to you, i actually created a second project with another context root and was making changes to it but displaying the output from the first context root therefore not really seeing the changes. Hey, caffeine can only do soo much at 3:00 am in the morning.
Hopefully people will avoid changing one project and running another ;)
(I think we've all done that at one point or another--opened a file from another project by accident, edited it, then been baffled why the change "doesn't work". I've been doing it for decades :)