Why JSP not use new class that I compile again?

I use bean class with JSP. But When I add some code and compile new bean. JSP not use new been class it use old class.
I try to set file server.xml and set <DefaultContext reloadable="true"/> and restart Tomcat. But it not work?
any help please?

I run JSP in http://localhost:8080/stringbean.jsp
is context name mean localhost
in c:\tomcat\work has following directory
standalone (level1 dir)
localhost (level2 dir)
- (level3 dir)
examples (level3 dir)
manager (level3 dir)
tomcat-doc (level3 dir)
webdav (level3 dir)

Similar Messages

  • Why not use "new" operator  with strings

    why we not use new when declaring a String .because in java String are treated as objects. we use new operator for creating an object in java .
    and same problem wiht array when we declare array as well as initialize .here we are alse not using new for array
    why

    Strings aren't just treated as objects, Strings are Objects.
    As for why not using new for Strings, you can, if you want.:
    String str = "this is a string";
    and
    String str = new String("this is a string");
    do the same thing (nitty-gritty low level details about literals aside). Use whatever you like, but isn't it simpler not to type new String(...) since you still need to type the actual string?
    As for arrays, you can use new:
    int[] ints = new int[10];
    or
    int[] ints = { 0, 1, 2, 3, ..., 9 };
    But the difference here is you are creating an empty array in the first one, the second creates and fills the array with the specified values. But which to you often depends on what you are doing.

  • Using custom classes that are not beans

    Hi folks,
    Is it possible to use java classes that are not beans. I mean, on a page, could you say Customer cust = new Customer("Jones", 25);
    if you had a Customer class with a constructor that took a name and age (String and int).
    If so, how do you go about this- do you need to import the class, or put it in a standard location? I'm using Tomcat, and would guess that this would go in WEB-INF/classes?
    I hope it's not a stupid question, all the literature seems to be focused on JavaBeans
    Any advice on this would be great!

    Beans are used as putting Java code into a JSP is generally considered bad practice. The advantage of the bean pattern is that you use things like:
    <jsp:setProperty name="laBean" property="someSetter" value="someValue" />so that you aren't embedding Java directly into the JSP. I'm not very religious about this particular topic personally and will throw a line or two in here and there.
    Having said that though, you can easily use any Java class in a JSP. You'll have to import it first:
    <%@ page import="java.util.*" %>And then you can easily use it like in a real Java program.

  • HT5463 I changed  password but can not use new password on phone. Why?

    I changed  password but can not use new password on phone. Why?

    Start with the Settings app
    Settings > iTunes and App Store > tap on your Apple ID and then tap on Sign Out
    Then sign in with your correct Apple ID and password.

  • How to deal with the rule that do not use "object" class to declear a class

    I run my flex project in sonar. And there is a rule "Do not use Object class ".
    I just want to know how to deal with this problem.
    I mean, when I try to write a base class, I don't know which kind of class will be transfered in by reference, which type I can declear instead of "object"?

    Check out this example:
    The moment I put in the code >> box1.addItem("hello"); << and run the application, the BusNameListener is fired. Hope this makes sense.
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    public class JFrameExample {
    private JComboBox box1;
    public JFrameExample() {
    box1 = new JComboBox();
    box1 .setMinimumSize(new Dimension(300, 24));
    box1 .setPreferredSize(new Dimension(300, 24));
    box1.addActionListener(new BusNameListener());
    box1.addItem("hello");
    JFrame f = new JFrame("This is a test");
    f.setSize(400, 150);
    Container content = f.getContentPane();
    // content.setBackground(Color.white);
    content.setLayout(new FlowLayout());
    content.add(box1);
    f.setVisible(true);
    class BusNameListener implements ActionListener {
    public void actionPerformed(ActionEvent e) {
    JComboBox cb = (JComboBox) e.getSource();
    String item = (String) cb.getSelectedItem();
    if (item != null) {
    JOptionPane.showInputDialog(null,
    "Specify...", "File Import",
    JOptionPane.OK_CANCEL_OPTION);
    }

  • Why are we using Abstract class?

    Why are we using Abstract class? What is specify use of Abstract class?

    The way I understand it....and I may be wrong because
    I am very new....is that by making the class abstract
    you will add abstract methods to it. Those abstract
    methods MUST be defined in in any subclass that
    inherits from the abstract class thereby making the
    abstract a template for subclasses.
    If your animal class is abstract then you would need
    an abstract method (Which is just siganture, no body)
    of say "numberOfLegs". Then in your dog and cat
    classes which extend animal you must define a
    "numberOfLegs" method with appropriate code.it isn't mandatory for an abstract class to have abstract methods. if a class does have abstract methods, the class must be abstract. but the following is perfectly legal
    public abstract class NoAbstractMethods {
      public void doStuff() {
         // do stuff
    }a subclass of an abstract class can also be abstract, and as such need not implement any additional methods

  • "The class being compiled does not match the class that was imported"

    ----------Actions on timeline in
    sixSpices/updateSite/updateSite.fla----------
    import com.sixspices.updater.view.*;
    var calDrawer:CalendarView = new CalendarView(); //Listener /
    view
    ----------sixSpices/com/sixspices/updater/view/CalendarView.as
    file----------
    class CalendarView {
    public function CalendarView(){
    public function onRecieveData(listOfEvents:Array) {
    displayEvents(listOfEvents);
    public function displayEvents(listOfEvents:Array):Void {
    trace(listOfEvents);
    When I test the movie (updateSite.swf) in flash, it gives me
    the error:
    The class being compiled, 'CalendarView', does not match the
    class that was imported,
    'com.sixspices.updater.view.CalendarView'.

    Here is my file structure:
    sixSpices
    -->updateSite
    -->-->updateSite.fla
    -->-->updateSite.swf
    -->com
    -->-->sixSpices
    -->-->-->updater
    -->-->-->-->view
    -->-->-->-->-->Calendar.as
    If I move updateSite.fla to the folder sixSpices so that
    "com" is in the same folder as it, I get the same error.
    The following works with no problems (no similar error):
    ----------Actions on timeline in
    sixSpices/updateSite/updateSite.fla----------
    import com.sixspices.updater.model.*;
    var calModel:CalendarOverview = new CalendarOverview();
    //Broadcaster / model
    ----------sixSpices/com/sixspices/updater/model/CalendarOverview.as
    file----------
    import com.sixspices.updater.model.*;
    import mx.utils.Delegate;
    import mx.events.EventDispatcher;
    class CalendarOverview {
    public function CalendarOverview(){
    }

  • HT4235 my iphone 4 wont connect to my laptop (windows 8) via usb but it will however register that it is there via 'photos' im not using the cable that came with my phone, does that affect the connection? i just want it to connect to my itunes again!!!

    my iphone 4 wont connect to my laptop (windows 8) via usb but it will however register that it is there via 'photos' im not using the cable that came with my phone, does that affect the connection?
    i just want it to connect to my itunes again!!!
    Thank you to anyone and everyone that manages to help!

    Hello webster995,
    Thank you for the details of the issue you are experiencing with your iPhone not appearing in iTunes.  I recommend following the steps in the article below to troubleshoot the issue you described:
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/TS1538
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • HT2731 I have created my apple ID yesterday and I could not use app store that shows a message that "This Apple ID has not yet been used in the iTunes Store". What should I do?

    I have created an Apple ID yesterday and I could not use App store that shows a message when I try to install something that "This Apple ID has not yet been used in the iTunes Store". What should I do?

    Try this support article >  Using an existing Apple ID with the iTunes Store, Mac App Store, and iBooks Store

  • HT1386 I unplugged my iphone while it was syncing with itunes and now it will not sync new music that I have added to itunes? How can i fix it?

    I unplugged my iphone while it was syncing with itunes and now it will not sync new music that I have added to itunes?

    iPhone User Guide
    The Basic Troubleshooting Steps are:
    Restart... Reset... Restore from Backup...  Restore as New...
    Restart / Reset
    http://support.apple.com/kb/ht1430
    Backing up, Updating and Restoring
    http://support.apple.com/kb/HT1414

  • My battery life on my new Iphone 4s is the pits!  I had a blackberry and so much better..I am not using my phone that much but don't even seem to get much out of it. Anybody help with suggestions???

    I am trying to figure out how to improve my battery life on my new Iphone 4S.  It is so poor !  I had a blackberry for few years and just bought my new Iphone. So disappointed in this battery life!
    Would appreciate any help I can get on improving battery life.  I am not using my phone for games.  Only use it for texts and emails and very little surfing.  Do have few apps. Don't use Siri much as I am in Canada and she isn't much help here like it is in the States; which is also disappointing.
    I took my phone off charger at 9am this morning and didn't use it much till about 1pm and it already was only 53%.  Used it a little for chatting with someone; a few emails and had to plug my phone in around 330pm.....
    Help me????? I have read some people and they are seem to be complaining about this issue big time.  Sure hope Apple does something about this!
    Mrsgolfie

    I understand all of this Meg; that is why I bought an Iphone; but never expected my phone not even give a at least a 24 or even 12 hours....I work 12 hour shifts and also would expect to have to charge each night but not twice a day or more.  I am not always somewhere I can charge my phone.
    Your points are true; however it doesn't help me......

  • Why JSP not move to jhtml direction?

    I have both knowledge of JSP and JHTML (from ATG). I like jhtml much more. The jhtml architecture is far superior than jsp. I just list following features:
    * better component naming, using directory and properties, instead of jsp.
    * excellent Form handling capabilities.
    * support expression
    * droplet is more powerful and simple than those customer tag.
    JSP is not better than MS ASP, which has better infrastructure, such as ADO etc. I don't understand why so many developers are fan of JSP, even Servlet! After a while, I am tired of them.

    I can't speak about jhtml, but I do disagree with you about the MS ASP comparison. There are lots of very important reasons why JSP is better, but I'll list a few:
    1. JSP is compiled, ASP is interpreted.
    This results in faster executing code and less bugs due to compile time checking.
    2. JSP (Java) is strongly typed, ASP is typeless (Variants)
    Typed variables are better with memory and much better with reducing bugs due to discovering incompatible data types. Consider the fact that a simple boolean as a Variant in ASP takes up 16 bytes (last I looked at the actual C struct used under the covers).
    3. JSP is platform independent, ASP only runs on Windows. Also, the are many different JSP containers to choose from, ASP only provides one.
    The competition between Weblogic, Websphere, etc. greatly improves the JSP market since the strongest survive over time. Consider the fact that MS only threw out ASP for ASP.Net because J2EE is affecting their market share.
    4. The scalability of ASP is severely restricted by the thread affinity of single-threaded apartments (STA) that IIS sets up to run non-MTS COM components. For example, you are committing scalability suicide if you keep any references to STA components in session or application state. And VB6 can only create STA components. You need VC++ to create MTS components.
    5. JSP has the ability for standard and custom tag libraries, ASP has no capability.
    Tag libraries are proving to be very valuable in the JSP space. A moderate use of well written tag libraries can severely increase developer productivity as well as reduce costs by shifting some page development from expensive Java developers to web designers.
    6. ASP requires IIS, which has major security holes in the software. Attest to the fact that the Code Red virus alone cost over $4 Billion in wasted productivity alone.
    Do not shrug off the above differences. They are major. They are the reason that developers have moved to the JSP world. If you're still not convinced, analyze why MS threw away ASP and produced ASP.Net. Despite what you read, ASP.Net is NOT simply the next version of ASP. They are architecturally two entirely different beasts. The proof of this is the fact that an ASP and ASP.Net page cannot co-exist in the same ASP application. That is, they do not share session or application state or cannot make calls into functions defined within each other. There's a reason for this.
    Except for item 3 and 6, ASP.Net solves all of the above problems. In fact, if you compare .Net to J2EE, it's frightening how MS did not violate some sort of an architectural copyright, if one exists. .Net is effectively a clone of J2EE.
    .Net is a good platform and will do well since MS is very committed to it. If you're a MS shop, you will be in good hands for new development. Besides being a proprietary platform, the only other problem is the massive amount of capital that will be required to migrate the millions of lines of VB, VC++, and ASP code to .Net. All the migration wizards in the world can never solve this!
    Good luck.

  • OC4J 9.0.4 migrate to 10.1.3.1 JSP fails using abstract class for ResultSet

    Consider the following JSP code snipet:
    <%
    com.class.SQLDataSource detail = ((com.class.SQLDataSource)request.getAttribute("AcctList"));
    %>
    <%while detail.next()) {detail.getRow();%>
    <tr ...>
    <td ...><%= detail.getString("ACCT") %></td>
    </tr>
    <%}%>
    blah, blah, blah
    class snipet looks like this:
    public abstarct class SQLDataSource extends serializable {
    private ResultSet resultSet = null;
    private PreparesStatement stmt = null;
    public boolean next() throws SQLException {
    boolean result = getResultSet().next();
    return (result);
    public String getString(String columnName) throws SQLExcpetion {
    return getResultSet().getString(columnName);
    public void execute() throws SQLException {
    -- checks stmt
    -- if null generates resultSet from "AcctList.sql" query
    -- if not null, re-executes as-is stmt for a query only
    protected ResultSet getResultSet() throws SQLException {
    execute(); // see above
    return resultSet;
    The problem:
    <%= detail.getString("ACCT") %> generates a NullPointerException
    Yet, if I add debug statements in the SQLDataSouce class, they conclusively show that resultSet has 1902 rows and I can diplay the contents on these rows (on the console, of course, the JSP still generates a NullPointerException).
    If I "hardcode" the creation of a ResultSet in the JSP, the pages displays properly (not the desired method).
    PLEASE TAKE NOTE: This JSP/Class combination works PERFECTLY in OC4J 9.0.4 using JDeveloper 9.0.5.2. When I deploy the **EXACT SAME** JSP/Class combination in JDeveloper/OC4J 10.1.3.1, I receive the NullPointerException.
    So what this feels like to me (and my VERY limited J2EE experinece) is that the abstract class SQLDataSource has somehow lost/closed/dropped/corrupted resultSet when "returning" to the JSP for display of the contents of resultSet. This is, of course, a laymans explanation of the experienced effect of running this code.
    It makes me wonder if under 10.1.3.1 "something more" must be done so that the (abstract) SQLDataSource class can operate in the same way it did under 9.0.4.
    Last note: this NullPointerException happens whether I deploy to standalone OC4J 10.1.3.1 or if I execute my application withing JDevloper's Embedded OC4J instance.
    Any Assistance on this MOST aggrivating problem would be greatly appreciated.
    Others have yet to solve it in similar posts of mine. Hopefully this more definitive description will help YOU be my personal HERO.
    Ed.

    repost to pique interest

  • Using a class that has a main from another class

    Can I call a class that has a main from another classes public methods?

    Yes, you can, although strictly speaking you won't be calling that classes "main" method, you will simply be calling and initializing the class through it's constructor, the "main" method will be ignored. If you have code inside your main method that you want executed as well consider moving it inside your constructor and simply using the "main" method as an application initializer:
    public static void main( String args[] ) {
    new MyClass();
    This way you can use your class as an application or call it from another class and not have any duplicate code inside your "main" method and constructor. You can also take this further and have it call the applet initialization so that you can launch it any way you like, I suspect this is a bit beyond what you were asking.
    Does this solve your problem?

  • Portlets development: When to use the class that extends PortletBridge...

    When I create some Portlet (.jspx based) JDeveloper generate some resources. One of those is a class (with the name that I´ve configured) that extends PortletBridge...
    Ok. So, I want to know if I use JSF standards should I put my actions into this class or should I create another Managed bean to handle that? What to do with this generated class?
    Thank you.

    So you want to create a portlet that uses JSF instead of JSP?
    You can JDev do that for you. When you create a new portlet there is a step where you can specify the default page for the portlet mode (view, edit).
    On the right hand side you can select ADF JSF (or something like that).
    JDev will then create a class that extends the PortletBridge class and you don't have to do anything more. Just edit the jspx like it's a normal page.

Maybe you are looking for

  • E60 lost wireless connection to network

    my E60 lost wireless connection to network. tried GPS, DUAL, automatic, manual search for network. Same SIM works fine with different phone. Any idea anyone?

  • Alert!  Newbie question

    I am going to be uploading streaming flv video from a home server. I need to know: Is xserve the way to go? I'd like to avoid a host server...any other mac-compatible servers that anyone has had good luck with?? I don't want progressive video uploads

  • Modify the videoembedplayer.aspx in Sharepoint 2013

    Hi All, As we all know that SharePoint has an OOB feature to play videos/Audios. The player which is used is Videoembedplayer.aspx I have a requirement, where in I would be playing only Audios, so the current VideoEmbedplayer.aspx treats an Audio as

  • Two sockets in a single server

    May I open two sockets with different listening port numbers in a single server? For each socket, the way to deal with the inputstream and outputstream is different. May the thread be like this: public class twoSocketServer implements Runnable { publ

  • NetInfo Manager in Leopard??

    I am trying to follow some instructions from the Tecplot Support page to correct an error message that I am getting. The instructions call for me to make some changes using the NetInfo Manager Utility. This utility does not appear to be in Leopard. I