• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Coordinate Printing in Java

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,

I have a java program that prints data based on coordinates. The program that takes the data and coordinates are on the server. The problem is, the printer prompt happens at server side as well, i need it to be at client side. Is there a way to do this? (Can you please suggest helpful links) Or should I resolve to other options like applets?

What do you think is the best approach in this solving this problem?

If I can add my road block when implementing the applet:
In my WEB-INF directory, I have a subdirectory called classes, inside classes is another subdirectory called util, and inside util is my JPrintThisApplet class. What should I put in the applet's codebase and code tag for the JPrintThisApplet to be recognized? I tried including and un-including the WEB-INF in the codebase (e.g codebase="WEB-INF/classes/") and maintaining code as (code="util/JPrintThisApplet.class") and all sorts of combination but it still wont work.
THEN
I imitated the same DIR hierarchy, placed a folder named AppTemp in the same location of WEB-INF, put the classes DIR inside AppTemp, along with its subdir util that contains my JPrintThisApplet.class, then have codebase and code as (codebase="AppTemp/classes" code="util/JPrintThisApplet.class") and it works perfectly.

I'm just not sure why it won't work with WEB-INF.

The JSP that calls the applet is in the same location as the WEB-INF folder.

Thanks and I appreciate all your help.

Rgs,
Keen
 
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The applet is executed on the client side.
Everything that is in the WEB-INF dir is not visible to the client.
So, you applet needs to be outside the WEB-INF dir. It has to be in the same dir as your JSP pages.
 
Rancher
Posts: 43009
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

It has to be in the same dir as your JSP pages.


That's not quite true. The codebase and archive attributes of the <applet> tag can be used to point to the code if it's not in the same directory as the JSP page.

Also, it's possible for a JSP page to reside inside of WEB-INF, in which case the applet code can't be in the same directory to begin with.
[ May 22, 2008: Message edited by: Ulf Dittmer ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!