File separator in Web applications

I learned that to make a web application run in both windows and unix environments file seperator needs to be taken from a system property called file.separator.
But when i develop webapplications in windows with hardcoded file separator it still works in UNIX
e.g <img src="/images/spacer.gif"> and even when i forward to jsp's
it still works
RequestDispatcher rd = request.getRequestDispatcher("/jsp/blah.jsp")
Can someone explain me how we got around that
Thanks in advance

But when i develop webapplications in windows with hardcoded file separator
it still works in UNIXThat's just fine? What's the requirement then? That it should not work in UNIX? And what exactly should not work? Web paths or absolute filesystem paths?

Similar Messages

  • How to create and save a file in flex web application ?

    Hi,
          I want to create and save a file form flex web application. Is it possible ?
    I have done some googling and found that its only possible through file referece, which needs some serverside implementation be called.
    Is it not possible with file reference to create and save file directly ?
    Can any one suggest how to over come this.
    Thanks in advance.

    Alex,
    code written with the Flex Builder 3 libraries will certainly run in Flash Player 10. However, what you need is not so much the capabilities of FP10 but the library functionalities of the Flex 4 package. And I think that Flex 4 code will only run in FP10 and not 9 (but haven't tested this as at work we have not yet been permitted to upgrade, so there is not a lot of point going for Flex 4!).
    Richard

  • Storing output file created by web application in specific folder

    Hi Friends,
    I am creating a text file through my web Application which is on JBoss and I have to read this file in the JSP to print the out put.
    My problem is, the text file has been created in JBoss/bin, I want it to be created in my project folder.
    Can some one please guide me in specifying the path to place the file.
    Thanks in advance.
    Preeti

    I want to add one more sentence to my previous message:
    I can do this by specifying absolute path but I want to specify this path in my web.xml. which tags should I add to web.xml ?
    Thanks,
    Preeti

  • Opening a PPT file from a Web Application

    Hi,
    I want to open a PPT file from my web application.
    I have provided an hyperlink of the complete path of the file. Once the user clicks on this hyperlink the PPT shall open.
    Kindly help me out with this.
    Thanks.

    Sounds like you're done. What happens when the user clicks the link?

  • How to install a war file as a Web Application Bundle (WAB) in CQ 5.5?

    How to install a war file as a Web Application Bundle (WAB) using CQSE and embedded OSGi Felix container? OSGi R4.2 specification specified Web application bundles which allows deploying war files as WABs insie OSGi containers. How do we do this in Felix container embedded in CQ 5.5?

    i m sorry, i intentionally wanted to post it in EJB forum, mistakenly i posted it in Servlets forum, anyways, if anyone of u know the ans, plz share it with me too.
    Thanx
    Nisha

  • Can any body tell where i have to place the mdb file in the web application

    Hi
    I am doing a web application in NetBeans 5.0 and using MSAccess (*.mdb ) file as a backend, so now where i have to place this mdb file in this web application in NetBeans. and tell me the code how to connect to that mdb file.
    The mdb file name is "db.mdb" and i am using a jsp page through which a servlet will be communicated. in servlet i am not able to connect to this mdb file.
    Reply asap.
    Sasi .

    DrClap wrote:
    duffymo wrote:
    Then I'd put it in my CLASSPATH. Maybe WEB-INF/classes.I'm not sure that I like the idea of the database being inside the web application's context. When you deploy a new version of the application, wouldn't that be a problem? My answer to "Where do I place the MDB in the web application" would be "Anywhere but there".DrClap, I'm embarrassed to read this, because you're only too correct. Thanks for the correction.
    When you think about it, your advice makes a great deal more sense. Any database BUT Access would be on a separate server (e.g., Oracle, MySQL, SQL Server, etc.) Why wouldn't that be a good idea for Access, too?
    On the other hand if it's a read-only database that would be different.You're too gracious to leave me this out. I throw myself on the mercy of the court for being a dumb ass. 8)
    %

  • Run a .sh file via a web application

    Hi,
    How can I run a .sh file via a web application? I want to start and stop a service in linux via a web app.

    a service in linux In Unix (including Linux) they are called rather daemons.
    Anyway, usually appropriate (root) privileges are needed to start/stop a dameon and a web application should not run as root.
    So be prepared that ome "sudo" magic might be needed.

  • Configure Log File for each web application deployed in weblogic server usi

    Hi All,
    How do I configure Log4J to log separately for each web application? i.e. Assuming, I have a web application "AWeb" and a web application "BWeb". I need a log file to be created for AWeb Separately and BWeb Separately. i.e. All the log information for "AWeb" web application will be stored in AWeb.log and all the "BWeb" web application will be stored in BWeb.log
    Do you have any sample code and configuration details for the above-mentioned requirement?
    Thanks in Advance,
    C R Baradwaj

    You do not need to do anything strange, just use log4j the usual way with the exception that you do not need to init log4j (this is not necesary when using a log4j.xml.)
    A minimal sample of a log4j.xml is
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
    <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
    <appender name="ConsoleAppender" class="org.apache.log4j.ConsoleAppender">
    <layout class="org.apache.log4j.SimpleLayout"/>
    </appender>
    <root>
    <priority value ="debug" />
    <appender-ref ref="ConsoleAppender"/>
    </root>
    </log4j:configuration>
    You just have to be sure that you have different log4j.xml in your classpath for different web applications.
    Regards,
    LG

  • How to use multiple configuration files in a web Application

    Hi,
    I am using JDev 11 TP3,JBoss4.2.1,Trindad 1.2.4.
    In my project I have to use a set of (Login) pages over several other projects.
    So I stored those pages (& backing beans) at an external location.
    Now while editing the deployment profile of the web application I included the login pages from external location using "Contributors".
    This way I was able to bring all the resources in the war. But the Faces-config.xml which contains the managed-bean registration of the login pages does not get included.
    1. Either I could change the name of the external faces-config and register it in the current project by includeing it. OR
    2. I could mention the managed-bean info in the current project's faces-config.
    I want to use option 1.
    How may I do it??

    Hi,
    if you package the managed beans in JAR files and add the faces-config.xml in the META-INF directory of it then it automatically registers at runtime
    Frank

  • Binary file support for web application in 10.3?

    There is such paragraph in Release notes for Flash Player 10.3:
    Binary file support
    Add more power to your web application with direct byte access to binary data. Control and access data in new ways, such as adding support for new file and data types or manipulating sound data in real time to create new sound effects.
    Does anyone know what do they mean by this exactly?

    Real programmers do it in binary!! ;-)

  • How to set a root directory for file management in web application

    Is it possible to set a default root directory for file management for a web application ?
    We would upload some files and store them in the web server.
    When we write the uploaded files without any path, the files are written in the config directory into the jdeveloper embedded oc4j directory.
    When we write the uploaded with a relative path ("/somedir/filename"), the files are written in C:/somedir/filename.
    We would like that all file management with relative path into the web application refer automatically to a given root directory (for example defined in web.xml).
    Is it possible ?

    I'm using the standard upload in adf faces.
    The problem is not during upload. This is managed in a temporay directory defined in web.xml. The problem is for writing the file that was uploaded (upload give us an inputStream we have to write somewhere, eventually after unzipping).
    Here is an example of our current code.
    if (mimeType.equals("application/x-zip-compressed") |
    mimeType.equals("application/zip")) {
    File destZipFile =
    new File(rootDirectory + "/" + parametersDirectory +
    "/" + uploadedFile.getFilename());
    BufferedInputStream isZipFile =
    new BufferedInputStream(uploadedFile.getInputStream());
    FileOutputStream fosZipFile =
    new FileOutputStream(destZipFile);
    BufferedOutputStream bosZipFile =
    new BufferedOutputStream(fosZipFile, BUFFER);
    // read and write until last byte is encountered
    while ((currentByte = isZipFile.read(data, 0, BUFFER)) !=
    -1) {
    bosZipFile.write(data, 0, currentByte);
    }

  • Accessing PDF files outside the web application

    Hi,
    I have deployed a web application Tomcat / webapps/ Moto.
    The Tomcat / webapps / Moto / resource.jsp file has links
    to a pdf file located outside the Moto web app.
    The pdf file is in Tomcat / webapps / doc / BAServerConfig.pdf.
    Now, I'm unable to access this pdf from the resource.jsp page.
    Is there any way i can do this?
    I'm not supposed to move this pdf file to any location.
    Please suggest.
    Thanks in advance,
    Phani

    I havent tested, but if it doesn't work, it should give you the idea:
    <%@ page contentType="application/pdf;charset=TIS-620" %><% response.setHeader("Content-Disposition","attachment; filename="+request.getParameter("id").substring(request.getParameter("id").lastIndexOf("/")+1));
      try{
        FileInputStream fis=new FileInputStream(request.getParameter("id"));
        ByteArrayOutputStream baos=new ByteArrayOutputStream();
        byte buffer[]=new byte[1024];
        int length;
        while((length=fis.read(buffer))>=0) baos.write(buffer, 0, length);
        baos.writeTo(response.getOutputStream());
      catch(Exception e){
        throw new ServletException(e);
    %>Be aware to not to broke ... %><%..... with spaces or return characters.
    And if this work, you can convert it to a servlet and enter corresponding entries in web.xml file.
    Hope this help,
    OO

  • File Class in Web Applications

    Hallo, i am creating a web Application but i need to know the fullpath of a file. I see that in the web based application i can call that FileReference class but with this class i can only get the name of a file and not the fullname. I can do this with the File Class which is avaible in Air Applications. How can i do it with my FlashPlayer application??....
    Thanks for all
    Max

    You can't get that with FileReference on the web (Security reasons). It was
    possible to get it with an HTML form and Javascript but I am not sure Firefox 3
    is still delivering the full path. Also not sure it works in all the browsers.
    C

  • ANT build script to deploy .EAR file SAP NetWeaver Web Application Server

    Can any one please tell me to deploy the .ear file with ANT build script in SAP NetWeaver Web Application Server.
    Thanks in advance.
    Regards,
    Venkat.

    Try these threads:
    Re: Is there a way to start a J2EE application per command line?
    Scripted WAS App Start Stop Deploy

  • Problem to read an external file in a web application

    Hello everybody.
    I'd like to know a method for reading a file (how I may connect to it?) This file is in a directory is in an external computer. I don't want to use a client/server application. I think that I must to use JNDI but I'm not sure. I think so becouse when I connect my application to external LDAP server, I use JNDI.
    I'm using Tomcat.
    Thanks a lot.
    Sorry for my English.
    I hope in your solution.
    Alessandro from Italy

    A quick Google found this:
    try
    Runtime rt = Runtime.getRuntime() ;
    Process p = rt.exec("Program.exe") ;
    InputStream in = p.getInputStream() ;
    OutputStream out = p.getOutputStream ();
    InputSream err = p,getErrorStram() ;
    //do whatever you want
    //some more code
    p.destroy() ;
    }catch(Exception exc){/*handle exception*/}Then of course you should realize that the path to the exe file must be in relation to the server.

Maybe you are looking for

  • Issues loading to a 3rd party host

    i created my site using muse and when i checked it out on business catalyst, everything looked great.  but now when i try to upload it to my 3rd party host, the site keeps getting messed up.  i've checked and rechecked my assets to make sure they're

  • Windows media player on safari???

    I want to listen to the radio. I can do that with a stream on the website of the station but I need a plug in for windows media player can some1 help me out??? THX anyway Flempie

  • Reduce White Space below Site Title and Above Site Content

    On a SharePoint Online site wiki home page, I'm in need of a Script Editor snippet that will reduce the amount of white space below the site title and the start of the body/content of the site.  (see attached image).  Thanks!

  • File adapter @ receiver end using fieldFixedLengths

    Hi , I am using file adapter @ receiver end using content conversion. Using field separator as 'nl'. When i open file in Hex mode it's showing the field separator as 2 Cariage returns(CR) & 1 line feed(LF). But the requirement is only 1 CR n 1 LF .  

  • Layer Mask thumbnails won't activate.

    I am using photoshop CC and am suddenly not able to activate my layer masks by clicking on the layer mask thumbnails. I am using Windows 8.1 if that matters. I have never had this happen before. Can anyone give me some help with this ? Thank you.