How can I judge the servlet directory?

hi there
I am learning web programming. I wonder when it comes the statement such as: "http://localhost/servlet/test", which directory is used? If I want to access a class file at, for example, e:\servlet, how can I do so? Anyone can give me a clue? Thanks.

You should post this in the Java ServerPages discussion forum, and you should also let people know what kind of application server you are using. And thirdly, you could just look at the documentation for your application server. Most tell you about the directory structure and where to put stuff.

Similar Messages

  • How can we access the file/directory system in the server

    Hi friends,
    I have made a text editor attached with an audio player for my project.
    Both text editor and audio player are implemented in applet and put in to a
    jsp page using jsp:plugin. Text editor and player are separate applets running
    in the same page and from same server.A client who is using this editor may
    want to save the edited text files to the server as well as hear audio files from
    directories in the server.
    My question is how can we access the file/directory system in the server
    like we do in the local machine.When the user cliks save or openfromserver button
    in the editor, folder/files in the server must be displayed as we do with FileChooser.
    I am using Apache Tomcat 5,wiindows 2000 server, jdk1.5.
    manu

    You can't access it directly. But your applet can make net connections to the server, and the server can provide that kind of functionality. Generally this is easiest by making HTTP connections and having the server provide the functionality via the web server. (So in your case, JSPs or servlets on the server would list/deliver/create/modify/delete files, and the applets would invoke those JSPs and servlets.

  • How can I convert the volume directory into a single file installer?

    How can I convert the volume directory into a single file installer? I would like to hide all the miscillaneous files that I don't care for and be able to have the installer double click a single file and have it automatically install.

    On the second prompt screen when prompted 'What kind of self-extracting Zip file file do you want to make?'
    Are you choosing the second option (self-extracting Zip file for software installation)?
    I have a word file that I created to help me remember - is there anyway to email it to you?

  • How can I copy the whole directory of files from PC to iPad?

    How can I copy the whole directory of files from PC to iPad ?

    Get an app that reads PDF's, such as iBooks or GoodReader or Readdle Docs, then use the file transfer part of iTUnes to get those files to your iPad, through iTunes. ( I have no experience with goodreader, but with ReaddleDocs you can move the files, then create folders to put them in to keep them organized)

  • How can I change the source directory in Netbeans

    Hi there,
    Thanks for reading.
    How can I change the source directory in Netbeans so I can have a src directory?
    Thanks,
    Lorenzo

    Forgot to say Netbeans 3.6.
    thanks

  • How can i know the home directory of my runtime report on registry

    Dear sirs,
    please how can i know the home directory of my runtime report on registry?
    i have a lot of homes and when i make file to modify the home directory it not done and that is mean that i make effect of another home, and i want to know which home is activated in registory.
    Thanks in Advance and waiting the help

    If you have a backup on computer iTunes see below:
    iTunes > Preferences... (Windows: Edit > Preferences...) > Devices > hover over your backup with the mouse, the serial number will popup.

  • How can i do the servlet to servlet communicaion usingservlet context

    public void doGet(HttpServletRequest request, HttpServletResponse response)
                   throws ServletException, IOException {
              response.setContentType("text/html");
              //ServletContext context = null;
              PrintWriter out = response.getWriter();
              RequestDispatcher rd=request.getRequestDispatcher("/second");
              rd.forward(request,response);
              out.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">");
              out.println("<HTML>");
              out.println(" <HEAD><TITLE>A Servlet</TITLE></HEAD>");
              out.println(" <BODY>");
              /*out.print(" This is ");
              out.print(this.getClass());
              out.println(", using the GET method");*/
              out.println(" </BODY>");
              out.println("</HTML>");
              out.flush();
              out.close();
    Here I have used request.getRequestDispatcher("/second ").. it wil cal the second servlet...
    But how can i cal the second servlet using context.requestDispatcher(" ") inside the paranthesis what i wil give?
    plz some one help me..

    request.getRequestDispatcher("/second ") is the same as context.requestDispatcher("/second ") .
    The requestDispatcher from the request object can take a relative path but if the path starts with a '/' it is interpreted as relative to the context root. The RequestDispatcher from the context can only take paths that start with '/' and are relative to the context root.
    http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletRequest.html#getRequestDispatcher(java.lang.String)

  • How can i know the servlet is running or not?

    Hi all,
           I have a doubt regarding servlet. I created one servlet and deployed in server. Now i called (RUN) the servlet from the browser. And it is running. Now can i know that the servlet is running or not in the server without seeing in the browser. Can we know the status of the servlet with its URL in the server whether it is running or not?
             Let me explain my problem. In my servlet it will run continously read one table and  do some operation depending on the entries in that table. Now i called the servlet from the browser. After some time i closed the browser. If browser is there i can know whether servlet is running or not. But now how can i know that servlet is running or not. Becoz eventhough we closed the browser the servlet will run in the background. How can i achieve this?
    Thanks and Regards,
    VJR.

    Hi!
    With first call, the servlet will be loaded, and it remains so until server-shutdown, but you need a timer-mechanism execute method calls continuously.
    Regards,
    Thomas

  • How can I get the servlet Context from a WebService Implementation?

    I have made a webservice endpoint, using the conventional way (WSDL->wsimport->Java interface->implementation) . I need to get the servlet context below the implementation class. I haven't found any way to get the servletContext though. Any clues? Any help will be greatly appreciated.

    yes  i can found the words's unicode form Cmaps where may be at the type of tounicde and another Cmaps table just like "Adobe-GB1-GBK-EUC" ,but when the word dont have either of them how can i do? when i write a chinese word "一",it just the winansi encoding ,  there is not Cmap for me to use to change the "G208f" to the word "一"'s unicode value.
                   best wishes      thank you very much

  • How can I get the working directory of a project from an Annotation Processor in Java

    I am writing an annotation processor in Java and in this annotation processor I want to be able to find a file in the Project hierarchy of the project on which I am using this annotation processor. Through the annotation I can pass in the path of the file I am searching for relative to the project root but i cannot retrieve the project's working directory.
    Let's say that the processor is MyCustomProcessor and I am using it on the project MyProject. I want to be able to access(read) a file (a properties file) from the project structure of MyProject from the "process" method of MyCustomProcessor.
    I have read this link Eclipse - Annotation processor, get project path but when I use their solution I get a null returned from the StandardJavaFileManager.getLocation(StandardLocation.SOURCE_PATH) call.
    Some more details regarding the implementation:
    MyAnnotationProcessor:
    @SupportedAnnotationTypes(value = {"MyAnnotation" })
    @SupportedSourceVersion(RELEASE_6)
    public class MyCustomProcessor extends AbstractProcessor {
    @Override public boolean process(final Set<? extends TypeElement> annotations, final RoundEnvironment roundEnv) {
    for (final Element element : roundEnv.getElementsAnnotatedWith(MyAnnotation.class)) {
    <!-- Here is where I would like to get the working directory !-->
    More details about the testing and development environment: Eclipse Kepler, JRE 1.7.
    If you need more details just ask.

    There is an identical post with an answer located at this link.

  • How can I find the Scripts directory from a script?

    Hello all! After playing with Photoshop scripting, I'm now playing with AE too, and in my first try I've stuck in finding the scripts path from the script itself.
    In Photoshop, there was this piece of code that somebody in the Photoshop Scripting forum kindly shared:
    var scriptsPath = new Folder (app.path + "/" + localize ("$$$/ScriptingSupport/InstalledScripts=Presets/Scripts"));
    But this line doesn't work in After Effects because app.path variable doesn't exist (very funny, I thought Photoshop and After Effects shared the same basic app variables) and the path given to the "localize" function is wrong in AE (I think "$$$" means nothing to it).
    Can somebody give me a clue about how to solve this? Thanks a lot in advance :-)

    This script shows a couple of examples you can try. The first part shows a way to get the folder the running script is in. The second gets the main AE app folder although I don't know if appFolder works on Windows (you'd still need to add /Scripts on Mac or /SupportFiles/Scripts on Win).
    var thisScript = new File($.fileName);
    var containingFolder = new Folder(thisScript.parent.absoluteURI);
    alert("This script is in " + containingFolder.absoluteURI);
    var appFolder = new Folder(Folder.appPackage.parent.absoluteURI);
    alert("The app folder is at " + Folder.decode(appFolder.absoluteURI));

  • How can I get the remote directory from an FTPActivationSpec header?

    The header message generated for the oracle.tip.adapter.ftp.inbound.FTPActivationSpec contains the file name, FTP host and FTP port. Is there any way of getting the remote directory as well?
    <schema attributeFormDefault="qualified" elementFormDefault="qualified"
    targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/ftp/"
    xmlns="http://www.w3.org/2001/XMLSchema"
    xmlns:FTPAPP="http://xmlns.oracle.com/pcbpel/adapter/ftp/">
    <element name="InboundFTPHeaderType">
    <complexType>
    <sequence>
    <element name="fileName" type="string"/>
    <element name="ftpHost" type="string"/>
    <element name="ftpPort" type="string"/>
    </sequence>
    </complexType>
    </element>
    </schema>
    This is already specified in the activation spec parameters:
    <activationAgents>
    <activationAgent className="oracle.tip.adapter.fw.agent.jca.JCAActivationAgent" partnerLink="ReadFileService">
    <property name="ftpRemoteDir" type="LogicalDirectory">out</property>
    <property name="portType">Read_ptt</property>
    </activationAgent>
    </activationAgents>
    But I don't want to have to add a separate preference parameter to hold the same thing if I don't have to. Alternatively, is there any way of querying the activation agent parameters from within an xpath expression, similar to "ora:getPreference()"?
    Cheers,

    add:
    <element name="directory" type="string"/>
    to the FTP adapter header WSDL

  • How can I use the /home directory

    I'm doing development work on my Mac (running Snow Leopard). The output location for the production server I use is under "/home/subdir". I'd like to develop my files on the Mac so they reside in the same relative location, but from the default install this is not possible.
    The /home directory is hidden by default. If I view hidden files, it looks like a mounted hard drive, but with no space. If I try to do something in the /home directory, I get "Operation not supported". For example, from the command line "sudo mkdir /home/test" returns "mkdir: /home/test: Operation not supported".
    (Originally, when I was useing Leopard, I moved the installed /home to /home_old and created my own /home directory, but the install to Snow Leopard reverted it back to the locked out /home dir. The other one was preserved, but it makes me nervous enough that I don't want to try it again without some reassurance.)
    So, the question: Is there a safe way to use /home on a Mac running Snow Leopard?

    Found the answer in another forum post here:
    http://discussions.apple.com/thread.jspa?threadID=2073807&tstart=0
    To get the /home directory back. Edit /etc/auto_master and remove or comment out the line that starts with "/home". Then reboot.

  • How can I find the servlet class name from inside a ServletFilter?

    Ive implemented a servlet filter, but need to discover the class name of any servlet class that gets executed.
    Ive dug through the spec and cant seem to find any path to do this.
    Seems the methods needed to do this have been deprecated. (for security reasons?)
    Is there any way to write a ServletFilter to grab this info?
    If not, is there any other way to capture every servlet execution in the container, time its execution, and log the class name along with the execution time?
    (***WITHOUT*** requiring a classpath over ride of any container provider classes)
    Any help is much appreciated. Been banging my head against this for some time now :(

    request.getServletPath() returns the part of the URL which refers to the servlet. It isn't the classname of the servlet but it should be a reasonable surrogate. If you log that, then you could write some code which reads your web.xml and uses the servlet-mapping elements to convert it to servlet class names later.

  • How can I reset the default directory view to "Details" sorted a-z when I "Save As" or have to choose files to upload?

    It's a recent problem. My default view now keeps coming up as "List", sorted z-a. And it returns to that even when I simply go up a directory level in the same transaction!
    I've deleted my Firefox prefs files as in the instructions for settings problems, but that didn't fix it.
    I run XP-sp3. In case Windows was overriding the browser, I reset my Windows Explorer Folder Options, to View All Folders as Details, a-z, then restarted Firefox, but apparently that's not the issue either.
    It's a small problem, but I use that feature a lot, so it's really time-consuming - and frustrating. Can someone help me fix this? Thanks!

    I'm not sure how, but the problem seems to be OK now. It reverted to normal after I deleted my accounts at two web sites I'd joined last week. I'm keeping my fingers crossed! Thanks.

Maybe you are looking for