*
The moose likes JSP and the fly likes Trouble accessing a singleton within a JSP page! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Trouble accessing a singleton within a JSP page!" Watch "Trouble accessing a singleton within a JSP page!" New topic
Author

Trouble accessing a singleton within a JSP page!

Roger Graff
Ranch Hand

Joined: May 29, 2001
Posts: 112
I'm having a dandy of a time trying to get an instance to a singleton within my jsp page. This singleton contains the a HashMap of field labels of the input fields. Anyhoo, when I call the singleton's getInstance() method, the app pretty much hangs, no errors that I can see. I'm using Visual Age 4.0 WTE and a Model 2 architecture. Here's the code for the JSP:

-------------------------------------------
<HTML>
<HEAD>
<TITLE>hello.jsp</TITLE>
</HEAD>
<BODY>

<%@ page import="service.ContentService" %>
<jsp:useBean id="bean" scope="page" class="bean.HelloBean" />
<H1>Who are you?</H1> <br>
<!-- this is what's causing it not to respond -->
<% ContentService service = ContentService.getInstance(); %>
<input type="text" value="<%=bean.getName()%>" >
</BODY>
</HTML>
Roger Graff
Ranch Hand

Joined: May 29, 2001
Posts: 112
Nevermind. I had a compile problem in an underlying class that was the root of the problem. I'm curious as to why my ContentService class compiled in the first place, but that is another matter all together!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Trouble accessing a singleton within a JSP page!
 
Similar Threads
Request Attribute confusion
newbie question on passing parameters
Error while testing attributes
why jsp cannot use this class, which is no problem when compile singlely.
first whack at JSP not working