Jon Brasted

Greenhorn
+ Follow
since Mar 18, 2004
Merit badge: grant badges
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jon Brasted

Hi.

Inside a JFrame's container, I have a JPanel. I have a JScrollPane inside that which currently has a JTextArea object. Using a menu item, I want to be able to change the contents of the scroll pane to a JTree. I can currently do it by getting the JPanel and then adding a new JScollPane object containing the JTree. However, when I do so, the frame shrinks and then (nearly) instantly resizes. I want the frame to 'stay put'.

Is there any way of doing this?

Thanks,
Jon
17 years ago
How would I know? I thought I dealt with the two main exceptions? (Jsp and IO)
18 years ago
JSP
Hi.

I have made a custom tag with the view of using it as a 'method', i.e. declaring the code for the method and calling it within a JSP page using the custom tag.

The problem I have is that the rest of the body of the page is not evaluated after the tag, even though I specify the return value EVAL_BODY for doEnd().

Would anyone be able to kindly have a quick look at the code?

Thanks.
Jon



18 years ago
JSP
Thanks. That's sorted the JDK 1.5 errors... now to work out how to reference the classes... maybe in web.xml? I'll have a look.


org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 64 in the jsp file: /mainIndex.jsp
Generated servlet error:
C:\Apache\Catalina\localhost\fileserver\org\apache\jsp\mainIndex_jsp.java:119: cannot find symbol
symbol : class RecordBean
location: class org.apache.jsp.mainIndex_jsp
ArrayList<RecordBean> arrList = DBAccess.browseAll();
^


An error occurred at line: 64 in the jsp file: /mainIndex.jsp
Generated servlet error:
C:\Apache\Catalina\localhost\fileserver\org\apache\jsp\mainIndex_jsp.java:119: cannot find symbol
symbol : variable DBAccess
location: class org.apache.jsp.mainIndex_jsp
ArrayList<RecordBean> arrList = DBAccess.browseAll();
^
2 errors



[ July 25, 2005: Message edited by: Jon Brasted ]


SOLVED: Put RecordBean and DBAccess in a separate package and imported them. Silly me!
[ July 25, 2005: Message edited by: Jon Brasted ]
18 years ago
JSP
Sorry. I forgot to include the error messages...


org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 64 in the jsp file: /mainIndex.jsp
Generated servlet error:
Syntax error on token "<", invalid AssignmentOperator

An error occurred at line: 64 in the jsp file: /mainIndex.jsp
Generated servlet error:
Syntax error on token "=", != expected



I believe I have narrowed the problem down to
'ArrayList<RecordBean> arrList = DBAccess.browseAll();', as uncommenting that makes the compilation problems go away, however, I can't see any fault with that class?
[ July 25, 2005: Message edited by: Jon Brasted ]
18 years ago
JSP
Hi.

I have a little problem with a JSP I have. I get errors that I can't track down.

By the way, I am not using JSTL because I am not sure if it is installed on the web development server I will be installing this webapp on. (Poor excuse, I know... )

The purpose of the following page is to call on a static class method for an ArrayList, extracts the data from that ArrayList and and build a table from it. The static method fetches data from a database, stores it in objects of class RecordBean (one object of class RecordBean for each row) and then stores those objects in an ArrayList of the type RecordBean.

I would appreciate any advice that can be offered to me.

Many thanks.
Jon



[ July 24, 2005: Message edited by: Jon Brasted ]

[ July 24, 2005: Message edited by: Bear Bibeault ]


EDIT: I have also added code for DBAccess.java


[ July 24, 2005: Message edited by: Jon Brasted ]
18 years ago
JSP
If that's the case, I don't understand why the HttpSession object is not passed from mainIndex.jsp to test.jsp??
18 years ago
JSP
Hi.

I have a strange issue. The first page (mainIndex.jsp) uses a login page called index.jsp to test whether a user is authenticated and if not, shows a login form. If user is authenticated, it uses jsp:forward to forward to mainIndex.jsp. A Java servlet is used by index.jsp to check the user's details are correct and if so, stores the authentication information in the HttpSession (sets "authenticated" value to true and "username" to the username of the user). This works fine and the username is shown on mainIndex.jsp.

The second page is just a test page hyperlinked from mainIndex.jsp that is supposed to get the HttpSession associated with the request header and show the username stored in the HttpSession. This does not work. Does anyone know why?

By the way, I am using Apache Tomcat 5.5.9 under Windows XP Professional but not using J2EE security as I don't have access to the server configuration files, in order to set it up.

Thanks.
Jon


=== mainIndex2.jsp ===



=== test.jsp ===
18 years ago
JSP
Hi.

May I please have some help implementing an 'interface', responding to user input like this... ?

[Run class]
"Welcome. Please enter your name: "
[user inputs his/her name]
"Thank you. Welcome 'name'. How may I help you?"
"1. I would like a drink."
"2. I would like some food."
"3. I want to go home."
[user types in 1]
"Here is a drink."
etc

I can take arguments when first running the class (e.g. java bar -name Jon -do 1) but I am not sure how I would turn that into a terminal type interface as described above.

I appreciate any help.

Thanks a lot.
Jon
[ February 14, 2005: Message edited by: Jon Brasted ]
19 years ago
This is what I think the difference is...

Project is a folder in which a collection of classes (and source code) reside.

Workspace is a folder in which a collection of projects reside.
[ February 11, 2005: Message edited by: Jon Brasted ]
Hi.

I use Eclipse 3.1 and it bugs me how Eclipse takes so long to start up. The splash screen loads and does not disappear for about 10 seconds, while all the modules are loaded. Is it at all possible to disable some to make Eclipse quicker to start up?


Is at all possible to have multiple 'workspaces' open at the same time within the same instance of Eclipse, much like with Netbeans? With Netbeans, you can have multiple projects within different directories (not just same parent directory) open at the same time using 'Mount Filesystem'. Is anything like this possible with Eclipse?


Many thanks for taking the time to read these questions and if you reply,
Jon
My code... (by a Java n00b )

and the error I get is...
App_SimpCntdwn.java:31: cannot resolve symbol
symbol : method drawString (int,int,int)
location: class java.awt.Graphics
g.drawString(countdown, 5, 20 + y); // this hopefully allows for a line space
^

Many thanks,
Jon
19 years ago
Is there some easy HTML that will make the applet area width and height get AUTOMATICALLY set? I keep getting the numbers wrong in the HTML and the applet is not always fully shown.
(maybe I just need to set it properly? )
Thanks.
19 years ago
"However, since the few browsers that support OBJECT do so with significant bugs, APPLET is currently a more reliable method of embedding Java applets." - http://www.htmlhelp.com/reference/html40/special/applet.html
Hmmm... what do most people use?
19 years ago