Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > Java Basics
|
Java Basics General beginning Java language questions that don't fit in one of the more specific forums. Please specify what version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 12th, 2006, 08:12 AM
Registered User
 
Join Date: Oct 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default setting codebase for applet inside jsp file

Hi all,


in my webapps named Cons i have an applet file named AppDem

i have a folder called dynamic under Cons

In dynamic i have a jsp file called afterlog.jsp , inside which i am calling applet AppDem using applet tag.

As the applet file AppDem.java and the jsp aftelog.jsp are not in the same folder i need to give path for Applet in codebase attribute in ht


Can anybody suggest how to give relative path for applet

My Webapp name is Cons

AppDem.java is the applet file present under /webapp/Cons/AppDem.java

afterlog.jsp is present in /webapp/cons/dyanmic/afterlog.jsp

I need AppDem.java to be in the same location. Because i am calling a servlet file from applet by forming a url like

m_urlAcceptor = new URL(docBase.getCodeBase() ,"/servlets/pTimer");

docBase.getCodeBase() returns the value "http://My IP...:8080/Cons" together with the string "/servlets/pTimer" gives the full URL

"http://My IP...:8080/Cons/servlets/pTimer".

So if i change the applet file location, this wont work.

now i am runnig the application by giving the value in codebase attribute as "c:\tomcat5.0\webapps\Cons" .

Just for testing purpose only i gave like this...

Now i need to give dynamic and relative path for applet AppDem in codebase attribute of applet tag in aftelog.jsp file...

even i finished developing the complete web app, i am not able to proceed only because of this

Looking forward for your earliest reply..

Thanks in advance








Similar Threads
Thread Thread Starter Forum Replies Last Post
Applet Drawing oval inside rectangle Lizane Java GUI 2 June 22nd, 2007 02:47 PM
can an applet read from a file starsailor Pro JSP 1 January 7th, 2005 12:58 PM
Applet file access kp_kurian Java GUI 0 June 13th, 2004 10:20 PM
Setting focus on a JTextField when an applet runs cs21cw Java GUI 1 January 1st, 2004 05:08 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.