[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.
I already have all that ready for drop-in.
Quote:
Originally Posted by
fishtoprecords
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 Code:
public class TemporaryOrderForm extends HttpServlet
with the same base html copy pasted into 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.
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.
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.