JSP packages

Discussion in 'Java' started by Roedy Green, Jun 4, 2004.

  1. Roedy Green

    Roedy Green Guest

    I have been digging around trying to find out how you specify the
    package for JSP code. I can't seem to find any tag. You would think
    there would be one since Servlets come in packages. Have I just
    overlooked it or do they all live in the default package?

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Roedy Green, Jun 4, 2004
    #1
    1. Advertising

  2. Roedy Green

    kaeli Guest

    In article <>, look-
    lid enlightened us with...
    > I have been digging around trying to find out how you specify the
    > package for JSP code. I can't seem to find any tag. You would think
    > there would be one since Servlets come in packages. Have I just
    > overlooked it or do they all live in the default package?
    >
    >


    You can do that if you precompile to a servlet and then add it to the
    servlet. The point of JSP is to make such things as packages
    transparent, so few users will want to do such a thing anyway.
    I believe the server (weblogic, tomcat, etc) usually makes a package for
    you - it is NOT the default package, IIUC.

    There IS the "extends" attribute of the page directive, but it is
    recommended to use it with 'extreme caution'.
    ----------------------------
    <%@page extends="package.class" %>
    This indicates the superclass of servlet that will be generated. Use
    this with extreme caution, since the server may be using a custom
    superclass already.
    ----------------------------


    --
    --
    ~kaeli~
    I can't sleep.
    The clowns might eat me.
    http://www.ipwebdesign.net/wildAtHeart
    http://www.ipwebdesign.net/kaelisSpace
     
    kaeli, Jun 4, 2004
    #2
    1. Advertising

  3. Roedy Green

    Neill Guest

    "Roedy Green" <> wrote in message
    news:...
    > I have been digging around trying to find out how you specify the
    > package for JSP code. I can't seem to find any tag. You would think
    > there would be one since Servlets come in packages. Have I just
    > overlooked it or do they all live in the default package?
    >
    > --
    > Canadian Mind Products, Roedy Green.
    > Coaching, problem solving, economical contract programming.
    > See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.


    You don't have to specify the package, just place them in a directory. For
    security, you can place them in a subdir of WEB-INF and call them using
    RequestDispatcher.forward();

    Here's a link to some best practices articles,
    http://www-106.ibm.com/developerwor...&view_by=Search&search_by=JSP best practices:


    Neill Laney
    http://www.laneyconsulting.com
     
    Neill, Jun 6, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Curt King

    Servlet and JSP packages

    Curt King, Aug 6, 2003, in forum: Java
    Replies:
    0
    Views:
    342
    Curt King
    Aug 6, 2003
  2. Paul  Smith
    Replies:
    0
    Views:
    759
    Paul Smith
    Nov 18, 2003
  3. Replies:
    0
    Views:
    4,503
  4. David Lyon
    Replies:
    19
    Views:
    611
    David Lyon
    Apr 24, 2009
  5. Ian
    Replies:
    3
    Views:
    191
Loading...

Share This Page