Code Management in JSP

Hi All,
I am trying to find, if it is possible to maintain code belonging to different modules in different folders. I used iPlanet 6.0.
Currently, in my application all my jsp's are in a "jsp" folder and all my classes are in "/jsp/Web-inf/classes" folder making it difficult to maintain.
What i want to achieve is to place all the common code in one jsp folder and all modules specific jsp's in folder named module1. Also corresponding Java in same folder. So, all jsp for module1 would be in a folder named "module1" and all the corresponding specific classes either a sub directory in "module1" or sub-directory under "/jsp/web-inf/classes".
Is this possible? What would be the changes I need to make in my classpath or iPlanet settings. Thanks for all your help.
RM

classes under the classes directory in subdirectories would be in that package, so if you don't know about class packages, you had best look thru the Java tutorials. For JSPs, you just create the folder and put the JSPs in it. When you link to the page, or include or forward to it, you have to have the folder name in front of the JSP file name... "page.jsp" --> "module1/page.jsp"

Similar Messages

  • How to put HTML content after the following java code in the JSP

    Hello Guys :),
    In the following jsp I force the user to download a file but I am not able to perform any action after I do this. I want to put some HTML code in this jsp at the end so that user has the option of doing other things after downloading the file.
    Any solution will be highly appreciated :)
    Thanks
    <%@ page import="java.util.*,java.io.*"%>
    <script language="JavaScript" src="common.js"></script>
    <%
    Hashtable hashTable = (Hashtable)session.getAttribute("platformAndSampleInfo");
    Date date = (Date)hashTable.get("date");
    String userName = (String)hashTable.get("userName");
    String dateString = date.toString().substring(0, date.toString().length()-9).replace(' ','_');
    dateString = dateString.replace(':','_');
    String fileExtension = (String)session.getAttribute("fileExtension"); //,getFileExtension(request));
    String outputFile = userName + dateString + fileExtension;
         File f = new File (outputFile);
         response.setContentType("APPLICATION/OCTET-STREAM");
         response.setHeader ("Content-Disposition", "attachment; filename=\""+ f.getName() + "\"");
    InputStream in = new FileInputStream(f);
         ServletOutputStream outs = response.getOutputStream();
              int bit = 256;
              int i = 0;
              try {
                   while ((bit) >= 0) {
                        bit = in.read();
                        outs.write(bit);
              } catch (IOException ioe) {
                   ioe.printStackTrace(System.out);
              outs.flush();
              outs.close();
              in.close();     
    %>
    <!--
    The following piece of HTML code is never reached
    -->
    <html>
    Want to display this
    <html>

    Thats odd.. try using out to print the character
    inst of creating the instance outs.. Maybe your
    overiding something.
    ex)
    char c='s';
    out.print(c);
    //the jsp will create the instance of out for you.

  • Also VERY frustrated:  No java-code executing within JSP

    Hi!
    I'm completely frustrated at last! It must be possible to install tomcat/apache correct but I'm not able to do so!
    New problem:
    I try to view a jsp with IE6 by selecting File\Open. If I choose the copy at '\tomcat\webapps\examples\WEB-INF\jspjbex4.jsp' suddenly Dreamweaver opens and show me the code of 'jbex4.jsp'. When I open a copy of jbex4.jsp located anywhere else on my computer the jsp is shown, but the problem is: No javabean-code is used although it is coded correctly.
    I guess the problem is with some classpath or something quite simillar. When I try to view the examples delivered by tomcat I've got the same problem: Whereever there should be output generated by java-code (e.g. by calling a method like <%= test.getDM() %>) there's nothing!!!!!
    So I checked if apache is working correctly. The test page is shown correctly. So the error must occure somewhere under tomcat. But when starting tomcat I receive no error message..
    Can anyone please help me?
    Thanx a lot!!!!!
    p.s. Yes, 'Normal' java-code is executed fine!

    With tomcat 1.3.3 you place the xml file with the context mapping in the conf folder under the tomcat install directory. You must give the xml file a name that starts with "apps-" followed by something unique, followed by ".xml". So for examle apps-testapp.xml is good. Inside the xml file place the code I gave you above then restart tomcat. Make sure to change the docBase value to the directory that contains your WEB_INF folder and change the path to whatever you want. If the path is set to "/" then you would use the url http://www.yourdomain.com/yourjsp.jsp. If the path is set to "/TestApp" then you use the URL http://www.yourdomain.com/TestApp/yourjsp.jsp.
    For newer version of tomcat I am not sure exactly where the context mapping goes. Instead of in an apps-xyz.xml file it might go in tomcats server.xml file which should also be in the conf directory in the tomcat install directory.
    Each webapp has its own config file which should be at /WEB-INF/web.xml. Look on google or something about that. All your classes go in /WEB-INF/classes/package.name/class.class.
    Put your class files into packages!
    for you you should put your bean at /WEB-INF/classes/testpackage/JspTest.class.
    In the code for JspTest.java place "package testpackage;" at the top then recompile. In your JSP file use <jsp:useBean id="ex4" scope="session" class="testpackage.JspTest" />
    -S-

  • Source Code Management

    Hi
    I am busy designing a new Java environment for our company. We are migrating from Forms to JEE. I would like to know what would be the best practice (if one exists) wrt source code management. Currently I am going with the following,
    1. All original source code saved on development application server (Linux).
    2. Use SVN to manage source from development application server.
    I am not totally convinced that this is the correct method of managing source code.
    What are my options?
    Should the source be placed on a seperate file server independant of my application server?
    Kind regards.
    Leon.

    Development servers is used to be quite unstable sometimes so I would prefer to store the SVN repository on some kind of file server, where a file backup procedure is already implemented. If you're using some kind of cruise control or automatic testing you could checkout the source code to the development server to run it from here or to build distributions.
    I'm familiar with both CVS and SVN and think that SVN is serving us best. We're just using a file based repository, on a network drive, protected by the normal file system permissions mechanism. I'm almost always using Tortoise SVN as client but the SVN client in JDeveloper is just fine, but I think the Tortoise SVN plugin in the explorer is just better.

  • NAC and BBSM access code management

    Hello,
    An organization has a network infrastructure in which a BBSM generates access codes for limited authorized time periods to allow Internet web access to wireless guests. If a guest exhausts the period he must request a new access code.
    Now, if a Clean Access Server is deployed for admission control, a possible option could be to bypass posture assessment for those guest users and leave the the BBSM operation unchanged: with access code management for control and accountability purposes.
    My doubt is if i could deploy some access code management capabilities in the NAC appliance, in order to move to it the access code mgmt functionality from the BBSM.
    I would really appreciate any comment about that.
    Thanks in advance.

    Hi,
    Check table 3 of the link below,
    http://www.cisco.com/en/US/products/sw/netmgtsw/ps533/prod_eol_notice0900aecd805aeb23.html
    Scrap that BBSM. You should be able to provide guest access w/ NAC. checkout this link
    http://www.cisco.com/application/pdf/en/us/guest/products/ps6128/c1031/cdccont_0900aecd805b8b5c.pdf
    Regards,
    arburt

  • Including the same html code in many JSPs

    Hello there!
    does anyone knows how can I
    include some html code into my jsp?
    I have to include it in all my JSPs, so I was thinking
    in a kind of "include"-tag
    written once in a file and being included in all other pages,
    without having to write it overe and over
    Thanks!

    (8-0)
    so easy
    think I'm needing a good page where all the tags are listed
    do someone know one?
    (each good page win a Duke)
    Thanks

  • Souce Code Management

    Hello -
    We user Oracle Tools and technologies for development. Oracle Forms, Reports, SQL Files (DB Objects), Discoverer, Portal, JDeveloper etc.
    We use very old version (10 years ago) of MKS source Code management tool and have not upgraded to latest versions.
    Wondering what is out there in Oracle world for reasonable cost. I do have a huge list from the next
    http://en.wikipedia.org/wiki/List_of_revision_control_software but wondering what should we go with.
    Any suggestions?

    We use cvs (concurrent version system) easy to handle and works well. Integration to Eclipse available...

  • Source code managements problems

    Hi all.
    I work for a coperation that mandates the use of a particular source code management software, MKS. They are moving to another solution soon, so it doesn't make sense to write an extension for it.
    My objective is to use MKS to manage source changes as a standalone tool, while using JDeveloper to modify and debug application code.
    I also have a requirement to put all runtime code into MKS as well, so that a complete runtime build can be performed from within any project sandbox and deployed (No 3rd party installations required). This would include jdeveloper jar files and compiled objects from other MKS / Jdeveloper projects.
    So far, I've discovered that the JDeveloper project libraries are referenced by full pathname, including drive letter. This means that each develeper sandbox directory must have the same root path and drive letter or each projects libraries must be maintained seperately. Neither I think is very pretty. Is there a way to use relative pathnames?
    I'm also wondering how many other problems I may encounter as I proceed. What is the intended model for supporting concurrent development using standalone source code management?
    Any ideas or suggestions would be greatly appreciated.
    Thanks in advance
    Keith.

    Yes.
    The issue comes into play when developer A may be developing on c:\jdev and developer B may be developing on d:\dev\3m\jdev. I would rather not have to mandate directory structure standards for the parent directories.

  • How am i supposed to prevent sm from pasting code in my JSP page?

    Hello,
    as i was testing my JSP page i noticed that when sm places code in an input box , it seems that the page is affected by that.
    Well i have a very simple form like:
    <form  style="text-align:left" method="POST" name="edit" action="Edit" >
    <input type="text" name="year" size="5" maxlength ="50" value="<%= convertdate.ReturnYear((resultset.getString(19)) %>">
    <input type="submit" name="Submit" value="Store Data" >
    </form>i noticed that when i was placing code in the button year of the form like:
    out.println("<HTML><HEAD><TITLE> " + "Error in PAGE BLAH BLAH BLAH" + " </TITLE></HEAD><BODY>");my website was affected by that and some pages looked different and couldn't display data from the database, although the data existed in the db.
    What am i supposed to do? How am i supposed to prevent a user from inserting code in inputs of a form?
    Also, sometimes when i was pasting code, some SQL exceptions appeared saying : Data too long for field etc.
    The weird was that the data was in the limit. I'm very worried about this problem because the sql exceptions show the names of my tables and i think
    that this is dangerous for malicious attacks in the website.
    Thanks, in advance!
    Edited by: g_p_java on Sep 5, 2009 5:09 PM
    Edited by: g_p_java on Sep 5, 2009 5:14 PM
    Edited by: g_p_java on Sep 5, 2009 5:15 PM

    smogura.eu wrote:
    All notices are important & how to say... you can place Java code in JSP, but in commercial job you will need to find new job.
    Well i'm not actually working somewhere, i'm student and i have to make this project.
    It's the first time I use JSP, servlets etc, so that's why i find a difficulty in using them.
    Why your pages are messed? If you put HTML code in db, rendered page is like
    ..="50" value="<HTML><HEAD...{code}
    this will prevent browser to render page properly. Well i was actually pasting some data in order to check if the data is too long for the field and afterwards the page changed and many fields disappeared...
    There are two ways to prevent inserting code, in your JSP, and you need use it, as no separating view logic, data acquisition from page will not prevent this error
    1. You need disallow user entering ", <, ' etc...., best way by validating input on server side, by this will prevent user from entering all texts, or
    2. You need replace all HTML special char with their HTML codes when rendering, the simplest way
    convertdate.ReturnYear((resultset.getString(19)).replace("\"", "&#34'").replace(...).replace(...)
    {code}
    You must use this in back logic.May you please elaborate on that, you mention that i shall replace the year with "&#34'",
    What is that "&#34'"?
    and why do you use 3 "replaces"?
    About prepared statements.
    Preparation will not only prevent you from SQL injections, but can speed up application, if your driver uses statement caching.
    Why after creating prepared statement, you then create normal statement, in your example code?I hadn't noticed that, thanks.I 'll change them. But Statement is less secure than PrepareStatement?
    Thanks, in advance!

  • Dynamically generate JSF Source code in a JSP

    Hi,
    I have a JSP and instead of writing the JSF source Code like:
    <h:inputText
    styleClass="entryInput"
    id="textNumberOfServerMachinesInput"
    value="#{DataAccess.value}"
    valueChangeListener="#{InputValueChanged.processValueChange}">
    </h:inputText>
    manually in the jsp I want the JSF source code to be added dynamically to the jsp.
    So what I want is including a tag in the jsp and this tag generates JSF source code like seen above.
    This source code should then be treated just the way it would be if I had written it manually in the JSP. This means that the dynamically generated JSF code must be interpreted and all Listeners and Beans work just fine.
    How can I make this???

    Hi,
    I have a smiliar problem:
    JSP:
    <h:panelGrid binding="#{fileUploadGrid.panelGrid}">
       <%-- emty in jsp --%>
    </h:panelGrid>The panel should be populated with items the backing bean creates in source code:
    FileUploadGrid.java
    public void setUploadFieldNumber(int uploadFieldNumber) {
        this.uploadFieldNumber = uploadFieldNumber;
        this.refresh();
    private void refresh() {
        if (this.panelGrid == null)
          this.createPanelGrid();
        List children = this.panelGrid.getChildren();
        children.clear();
        for (int i = 0; i < this.uploadFieldNumber; i++) {
          HtmlOutputText out = new HtmlOutputText();
          out.setTitle("Image " + i);
          out.setRendered(true);
          HtmlInputText in = new HtmlInputText();
          children.add(out);
          children.add(in);   
    private void createPanelGrid() {
        this.panelGrid = new HtmlPanelGrid();
        this.panelGrid.setColumns(2);
        this.panelGrid.setCellpadding("1");
        this.panelGrid.setBorder(1);
        this.panelGrid.setWidth("50%");
        this.panelGrid.setRendered(this.isRendered());
    public void setPanelGrid(HtmlPanelGrid panelGrid) {
        this.panelGrid = panelGrid;
      public HtmlPanelGrid getPanelGrid() {
        return this.panelGrid;
    }The backing bean is initialized in faces-config.xml:
    <managed-bean>
      <managed-bean-name>fileUploadGrid</managed-bean-name>
      <managed-bean-class>org.smi.pte.isf.FileUploadGrid</managed-bean-class>
      <managed-bean-scope>request</managed-bean-scope>
      <managed-property>
        <property-name>rendered</property-name>
        <value>true</value>
      </managed-property>
      <managed-property>
         <property-name>uploadFieldNumber</property-name>
         <value>6</value>
      </managed-property>
    </managed-bean>The problem is: although the debug output of the faces framework (I use it along with Tomcat) shows that the in- and output fields are added correctly to the panel, the page remains empty at display.
    Thanks in advance for any help.
    F. Eckhardt

  • How can i execute some code in a jsp page on the same page ? plz read.

    I have made a single JSP Page where in i want to delete users, create users, update table data.
    I have all the UI on the first page. Now i want to write my all JDBC coding on just this single page. I don't want to create 3 separate pages. Can it be done ?

    This is my page !!
    I have 3 separate pages insert.jsp, delete.jsp, update.jsp to implement the jdbc coding. I know that i can get it done by calling a single jsp page using URL rewriting. But i want to code for events on this very page only.
    <%@page language="java"%>
    <%@page import="java.sql.*"%>
    <HTML>
         <BODY>
              <form method=post action="insert.jsp">
                   Username:<input type=text name=username><br>
                   Password:<input type=password name=password><br>
                   <input type=submit>               
              </form>
              <hr>
              <form method=post action="delete.jsp">
                   Username:<input type=text name=username><br>
                   <input type=submit>               
              </form>
              <hr>
              <form method=post action="update.jsp">
                   Username:<input type=text name=username><br>
                   Password:<input type=password name=password><br>
                   <input type=submit>               
              </form>          
         </BODY>
    </HTML>

  • Code Insight and JSP and JDEVELOPER

    Hi everybody
    Does anybody can help me how I can enable code insight feature of jdeveloper?
    Remember that import statement is in jsp tags.
    Thanks a lot
    Shahram

    The Code Insight feature currently only works with .java files.
    null

  • Code to connect jsp with MS SQL SERVER 2000

    i have my SQL Server in my local machine and i need to conne ct my jsp page with that instance.
    please provide a sample code to accomplish the same.
    along with that can you please send me procedure to establish a DSN for SQL SERVER 2000.
    thank you
    with love
    AnushhPrabu

    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSTL7.html
    This is a good way of achieving what you want to do. But I should mention that the approach is suitable only for smaller applications.

  • How to prevent the code viewing of jsp files

    hello friends
    How to prevent the code viewing on directly opening .jsp files at the server side
    Thanks in advance

    hello friends
    How to prevent the code viewing on directly opening
    .jsp files at the server side
    Thanks in advanceWhat exactly do you mean by code viewing? If by that you mean you don't want all the folders to show in the directory create a index.jsp file that has all the links to the pages you want to show
    If you mean something else please clarify

  • Software for code management

    I wanted to know if there is any software for management of code from sun ??
    .. something like Visual Source Safe ...
    If you know any others used popularly please let me know.. I am looking for something easy to use for windows users...

    Actually everyone will be using it... so i waslooking
    for something easy for windows users to use.
    CVS is more command based.. and I dont see Visual
    Source Safe going anywhere... They dont have Visual
    Source Safe.NET also..In my opinion Subversion and using the tortoiseSVN
    client for win32 (http://tortoisesvn.tigris.org/) is
    so infinitely better than source safe, it's laughable.
    And its free!Unfortunately I'm stuck with VSS at my company, but thanks for the heads up on Subversion, dmbdmb. I didn't know about it.

Maybe you are looking for

  • Choppy, distorted audio on Portege Z930 after updating from Win7 to Win8 64

    Just wanted to share an info with you which cost me some time to work out, regarding the audio playback on a Portege Z930. When I got my brand new Z930-14L, it was running Win7. I tested everything like you do when you get a new machine and it all wo

  • How to change mail default account

    I have several mail accounts gmail, comcast.net and icloud, how do change the defaunt out going account.

  • Error 0xc00007b occurs when opening Photoshop CS6?

    Trying to re-install after Windows 7 crashed and service centre re-installed the OS.  now CS6 Photoshop doesn't come up cleanly.  it gives error 0xc000007b

  • Organisation unit not getting determined

    Hi All, I have configured 4 transaction. Same partner determination profile, text deter procedure, org. data profile and date profile is assigned to all of them. But in only 2 of them organisational unit, sale office and sales group is not getting de

  • Update Phase Component From Project Component

    Morning all. I'm looking at options we might have open to us for the following scenario. Any ideas? Previous experiences,  etc most welcome ... We have a custom field in DPR_DET_DATA_PROJECT_O that we transfer to PS, but want to use the same field va