my dog learned polymorphism
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

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Java Web Service response problem" Watch "Java Web Service response problem" New topic

Java Web Service response problem

Kieran Neeson

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:
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>
<td><label for="pdbID">PDB ID:</label></td>
<td><input type="text" name="pdbID" id="pdbID" size="5" value=""></input></td>
<td><label for="tolerance">CCS tolerance:</label></td>
<td><input type="text" name="tolerance" id="tolerance" size="5" value="1.0"></input>%</td>
<td><label for="radius">Gas radius:</label></td>
<td><input type="text" name="radius" id="radius" size="5" value="1.0"></input></td>
<div id="form-content-button">
<input type="submit" value="Calculate CCS" name="b2" class="ccsbutton"></input>

Everything works and the response is as I expect it:
<!DOCTYPE html>
<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>
<div id="container">
<div id="header">
<div id="logoBar">
<div id="logoBarLeft">
<img src="images/logo1.png"/>
<div id="logoBarRight">
<img src="images/Waters.png"/>
<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>
<div id="content">

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?



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.


I agree. Here's the link:
subject: Java Web Service response problem
It's not a secret anymore!