Results 1 to 9 of 9
  1. #1
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Default [SOLVED] Web-App not avaliable under ^-N

    NetBeans: recent installation.

    I have an app that could gain a great relibility boost by seeing how NetBeans would do it. The help files says to do a File/New and select Web Application. All I can see in the wizard is standalone with main(); JSwingDesktop; Library Project; FreeForm Project; and Java Project From Existing Sources.

    I just got NetBeans two days ago so it must be current. I have one or two get-going projects underway.

    A Forms from example sources.

    A Swing app for first MyApp

    A Lib I just compiled but do not know where to put.

    I have a server with Tomcat up on the open wire, I have no idea whether NetBeans IDE tried to load Tomcat locally, but Tomcat does not show up on the Process List / local development platform.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  2. #2
    fishtoprecords's Avatar
    fishtoprecords is offline Senior Member
    Join Date
    Jun 2008
    Posts
    571
    Rep Power
    7

    Default

    Do the NetBeans new -> web app thing, let it generate the code, put "hello world" in it, and make that all run.

    Then you can add in real classes to do real stuff

  3. #3
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Default I already have all that ready for drop-in.

    Quote Originally Posted by fishtoprecords View Post
    Do the NetBeans new -> web app thing, let it generate the code, put "hello world" in it, and make that all run.
    I have the base jsp page coded, as a simple copy paste of the index page that already works. I have come up with package kitty - so that I will have a package name. I am using TemporaryOrderForm so that I use 'meaningful class names' as a mental note to be sure and not leave this running untested. I have
    Java Code:
    public class TemporaryOrderForm extends HttpServlet
    with the same base html copy pasted into
    Java Code:
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    and am looking at doPost(..... wondering whether I should just put what I have already in there as getting this MeanBean is so that I can deploy on Tomcat with a reasonably tested prototype.

    I have three states:

    1/ ship a base html page
    2/ Order processing
    3/ Flush the order

    This stuff is not all that hard to write, it does take some contemplation and I have a great deal of it prototyped already in doPost() as I have it. A short test run on local would make prototyping more effective. Everything I have up now is in /kitty/ on the public server. Everything that comes in to kitty goes to someplace in this project I now have open in NetBeans.

    Server level 3 help rewrote my .htaccess and provided pointers on a /kitty/index.html that would point to /kitty/kitty.html - which is where I have the page right now.

    What I have in processRequest is the equivalent of kitty.html

    I figured out I need to have a final static Character for " to avoid manually escaping literals.

    { choking on Humble Pie: }
    Try really hard to focus on loading and testing my first web application, I am hurting to get a simple app up - maybe I will not have to manually fix 193 lines of html again. This is at least the tenth time to do that, I have to get the server to issue something so that I can subject it to wc3 checker and so on. Sometimes simple sample drive the project in unwanted directions.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  4. #4
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Default OrderFormRequestObject

    Okay, I put OrderFormRequestObject, a simple Java class that does not extend something in the Libraries and serves OO by putting the Order Form Request Infomation all in one place copy-pasted onto a source code file generated by using the wizards. The IDE has not found anything wrong with it but I am totally commited that it will want to refactor this and other things. I have line 105 through 197 slapped up there as doPost and the thing is moanin already because some of the placeholder stuff is not used, probably will show up now that I have doPost copy-pasted over.

    I would not load someone else like this, fishtop, it is just that you have some miles already with me on this, I know you can keep the kittens and the mice separated.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  5. #5
    fishtoprecords's Avatar
    fishtoprecords is offline Senior Member
    Join Date
    Jun 2008
    Posts
    571
    Rep Power
    7

    Default

    Hmmm, Just to keep in sync, I fired up my NB 6.1 setup and I can't find Tomcat. I'll have to look. I remember that NB 6.* had a new 'feature" where TomCat wasn't as transpartent as it was in 5.5.

    More as I know more

  6. #6
    fishtoprecords's Avatar
    fishtoprecords is offline Senior Member
    Join Date
    Jun 2008
    Posts
    571
    Rep Power
    7

    Default

    Yep, seems they have a new "feature" and tomcat is not there by default. Sorry.

    This may help get you going.
    NetBeans Wiki: InstallingNetbeans6.0OnUbuntu7.10

  7. #7
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Default features are fearless

    Quote Originally Posted by fishtoprecords View Post
    Hmmm, Just to keep in sync, I fired up my NB 6.1 setup and I can't find Tomcat. I'll have to look. I remember that NB 6.* had a new 'feature" where TomCat wasn't as transpartent as it was in 5.5.
    I did a right-click on context drop down menu that said ( basically - I do not have it open right now ) Run it! and it fired up a server and took over one of the five or ten browser windows I had open. Presumably the one it works from normally as I did not loose anything I had open. The kitty page came up right there looking rather normal. I will place some comment markers in html comments in each of the doGet / doPost methods so I can differentiate the get requests being served from the doGet or doPost calls in the servlet.

    Design logic hinges on doPost looking for some name values an just passing to doPost if things do not match up. Amazing that the tool spotted I had not made an accessor method for the Map, but did not force a recompile and book buy. I think they're sneaking up on me. ( humor, folks - fishtop can deal with it I assure you )

    I saw doGet calling the base service method where I had placed what was essentially the same html as the static kitty.html. I do not care whether this html is served from the servlet or static html when it gets on the commercial open wire ~ code has to remain almost totally in sync there or I lose my path of control design logic. State machine is we are either in service on an active transaction with a human who can think or we are serving static html :: one or the other but not both.

    I had spec'd to use Tomcat during the install.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  8. #8
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Default Feature or fissure?

    Quote Originally Posted by fishtoprecords View Post
    This may help get you going.
    I was smart enough to select tomcat in the install, I also probaly selected the kochi thing as a servlet mapping because I had read about servlet mapping and so on in Marty Hall's book.

    What I need help on right now is assistance finding the 'Make avialable Globally to all Projects' PayPal's drop in Mason Jar by dropping it into the correct directory so that I can begin reading their developer docs and sign up for the sandbox prototyping area.

    Putting it in the libs dir for this paticular project is totally acceptable. I already put a libs dir in this project ( kitty / kochi ) on the advice of the IDE so that it could JUnit test. That would be not hard to find and as well as avoid cluttering the global development space. I have made this mistake before, what I want to avoid is having the IDE take over some dir on some place on my machine that it has no business fiddling with. The Mason Jar is zipped.

    { Mason Jar is VanHook's Shell Hook library. }

    edit: this is the kit I obtained:
    Java Code:
    //PayPal_Java_WPS_Toolkit.zip
    somewhere else before I arrived at that point I read the libs are shipped as a drop in jar. I have not backtracked to where I read that or found it. They use BC, I saw that already.
    Last edited by Nicholas Jordan; 07-04-2008 at 07:19 PM.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  9. #9
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Default to stay within sight of each other

    Wrote this this afternoon, about to saturate. Simple helper class. One of those things I might get hammered on later. Fixed the static synchronized accesssor in the serlvet / sevice ~ I had left off when I was about to write an accessor method and laid down for a few hours to get the IDE functional. When I loaded the doPost in the IDE the fancy tool spotted it with all the nervous flitter that makes it glitter. Commented out some other placeholders, will be studying some other packages I looked at today. Looks promising for kitty. This is a utility class that has some tangential to the other thread about the schduler. I place it here because this work was from scratch in the IDE. Getting this much done in one of those things in one afternoon requires I keep the other tools handy.

    Sometimes crossovers find things, they do it in accounting.

    Java Code:
    package kitty;
    
    /**
     * Discussion of opinion in a technical forum.
     * No legitimate derivative use.
     */
    
    public class Background  extends java.util.TimerTask
    {
        java.security.SecureRandom sr;//
        java.util.LinkedList<Integer> victor = new java.util.LinkedList<Integer>();
        java.lang.Boolean isValid;//
        java.lang.Boolean isLoaded;//
        java.lang.Integer size;
        
        public Background(int size)
        {
            this();//
            if(this.isValid.booleanValue())
            {
                this.size=new java.lang.Integer(size);//
                return;
            }    
            else
            {
                this.size=new java.lang.Integer(0);
            }
        }
        private Background()
        {
            super();//
            try
            {
                sr = java.security.SecureRandom.getInstance("SHA1PRNG");//
                this.isValid=new java.lang.Boolean(true);//
            }
            catch(java.lang.Exception e)
            {
                this.isValid=new java.lang.Boolean(false);//
            }
        }
        // Determines valid state of this.
        public synchronized boolean validState()
        {
            return Background.this.isValid.booleanValue();
        }
        // Cancels this timer task. 
        public boolean cancel() 
        {
            return super.cancel();
        }
        // The action of this timer task is the generation of SecureRandom Integers
        // for use in authenticaion and session management. This is in addition to
        // the server's idea of a session. We could do if victor.size() < minSize or
        // otherwise replenish the cache here if we want to do scaleable work during
        // prototyping. That's one of those where experience either rules or can help.
        public void run()
        {
            if(Background.this.validState())
            {
                if(Background.this.size.intValue() > 0)
                {
                    int index = 0;//
                    do
                    {
                        Background.this.victor.add(new java.lang.Integer(sr.nextInt()));//
                    }
                    while(++index < Background.this.size.intValue());
                    Background.this.isLoaded = Boolean.valueOf(true);//
                }
            }
            else
            {
                Background.this.isLoaded = Boolean.valueOf(false);//
            }
        }
        public synchronized boolean Loaded()
        {
            if(Background.this.isValid.booleanValue())
            {
                if(Background.this.isLoaded.booleanValue())
                {
                    return true;//
                }
                else
                {
                    return false;//
                }
            }
            else
            {
                return false;//
            }
        }
        //Returns the last time this was run
        public long scheduledExecutionTime() 
        {
            return super.scheduledExecutionTime();
        }
        //  Pull an int from the fifo.      
        public synchronized Integer getInteger()
        {
            if(Background.this.isValid.booleanValue())
            {
                if(Background.this.isValid.booleanValue())
                {
                    if(Background.this.victor.size() > 0)
                    {
                        // Ahhh,.....
                        return Background.this.victor.removeFirst();
                    }
                }
            }
            return new Integer(0);
        }
         
    }
    We have a design flaw that could creep in pulling elements and so on. Details.
    Last edited by Nicholas Jordan; 07-05-2008 at 03:07 PM.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •