*
The moose likes Web Services and the fly likes Java Web Service response problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Java Web Service response problem" Watch "Java Web Service response problem" New topic
Author

Java Web Service response problem

Kieran Neeson
Greenhorn

Joined: Jun 13, 2012
Posts: 1
Hi I have created a java web service but I have a problem I do not understand.

The function I am calling is:
@GET
@Produces("text/html")
public String calculateCCS(@QueryParam("pdbID") String pdbID, @QueryParam("tolerance") double tol, @QueryParam("radius") double rad)

and within my html client I use a form
<form method="GET" action="http://localhost:8080/CCSCalcApp/resources/ccscalc" name="f1" id="f1">
<h1>Calculate CCS</h1>
<table>
<tr>
<td><label for="pdbID">PDB ID:</label></td>
<td><input type="text" name="pdbID" id="pdbID" size="5" value=""></input></td>
<tr/>
<tr>
<td><label for="tolerance">CCS tolerance:</label></td>
<td><input type="text" name="tolerance" id="tolerance" size="5" value="1.0"></input>%</td>
<tr/>
<tr>
<td><label for="radius">Gas radius:</label></td>
<td><input type="text" name="radius" id="radius" size="5" value="1.0"></input></td>
</tr>
</table>
<div id="form-content-button">
<input type="submit" value="Calculate CCS" name="b2" class="ccsbutton"></input>
</div>

Everything works and the response is as I expect it:
<!DOCTYPE html>
<html>
<head>
<title>CCS Calc</title>
<meta content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" name="viewport" />
<LINK REL=StyleSheet HREF="style/style.css" TYPE="text/css" MEDIA=screen>
</head>
<body>
<div id="container">
<div id="header">
<div id="logoBar">
<div id="logoBarLeft">
<img src="images/logo1.png"/>
</div>
<div id="logoBarRight">
<img src="images/Waters.png"/>
</div>
</div>
<ul class="highlight blue">
<li><a href="home.html"><img src="images\calc.png" alt="Calc"/></a></li>
<li><a href="keyword.html"><img src="images\key.png" alt="Keyword"/></a></li>
<li><a href="info.html"><img src="images\info.png" alt="Info"/></a></li>
<li><a href="contact.html"><img src="images\contact.png" alt="Contact"/></a></li>
</ul>
</div>
<div id="content">
</div>
</div>
</body>
</html>

However when the response returns it looks like this in my browser - see attachments.
Why do the images and styles referenced in the response not visible?
What am I doing wrong or am I expecting the wrong thing?

Thanks

Kieran




William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 859

Welcome ...

You forgot the attachment, and please use code formatting tags in the future.

From a quick scan it looks like you may have a backslash/forward slash issue.

e.g:


WP
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Web Service response problem