raju svgk

Greenhorn
+ Follow
since Sep 25, 2002
Merit badge: grant badges
For More
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 raju svgk

My requierment is to create a jsf datatable with dynamic number of columns. I get the data in a Hashtable array and keys in that Hashtable is the table headers. Even Hashtable keys are not always the same.

How to address this requirement with jsf datatable? Is there any sample code available?

regds
-raju
15 years ago
JSF
In the given example find.jsp is JSF only. I am treating JSF means backing bean with an associated JSP. In my JSF I can access the backing bean attribuites trough <h:outputtext ..../> etc., Now I want to access those backing bean attributes between

<%

%>

How can I achieve this?
16 years ago
JSF
Hi, I need to access backing bean variables directly from the JSP. Not able to figure out how to do it. I created a Hashtable (details) and String[] (header) variables in the backing bean and initialized both in the corresponding backing bean constructor. Now I want to access those two variables from the JSP and apply some logic to format them properly. How can I do it?

Backing bean code

package com.itools.vs.view.backing.General;


find.jsp JSP code:

faces-config.xml
16 years ago
JSF
Hi,
I have a JSF page and a corresponding backing bean class. To initialize the html form fields within the JSF page, I wrote a piece of code to call a sateful session and get the information from the DB. However, while loading the page, backing bean constructor is getting called twice and hence session bean method is also getting called twice.

1) How can we avoid calling the session bean method more than once?
2) Is there any annotation that can be specified for a method, so that it can be called only once while loading the page?
3) I have seen somewhere saying that prerender can be used to make sure that the corresponding method gets called only once. How to specify that? Any example?

Thanks
-raju
17 years ago
JSF
I am using JSP and Servlets in my web application. When users enter some data in a form and resize or iconize browser window, all the entered data is lost. How to avoid this? This is happening in both IE and Netscape.
regds
-raju
19 years ago
JSP
I am using servlets and JSP and in my web application. When users enter some data in a form and resize or iconize browser window, all the data entered is lost. How to avoid this? This is happening in both Netscape and IE.
regds
-raju
Hi,
I am developing a web application with servlets, stateful sessionbeans, CMP beans, and oracle 8.1.6. In our application we are trying to generate reports dynamically. To generate report dynamically it takes minimum 1min. Meanwhile (when the report download is in progress) if user clicks any link or any other button with in the same form that is provided on the webpage, I am getting the following error. What is the reason for this? How to solve it. I cannot restrict users not to click the other links on the webpage.

thanks and regds
-raju
Hi,
I am using HttpServletResponse and ServletOutputStream. The code is as follows:

Actually when I click "Run Report" button in a html form, this method will be invoked. The actual requirement is after I click the "Run Report", .pdf should get downloaded and goto a different page. To achieve this I used response.sendRedirect() method. I got the following error:
java.lang.IllegalStateException: Response has already been committed, be sure not to write to the OutputStream or to trigger a commit due to any other action before calling this method.
Is there a way to redirect from a page to another when I used response.getOutputStream().
Also, if any errors occured, how do I show it. Actually in my code I am trying to get Writer object to show error messages. This will not work. Any ideas how to show error messages when response.getOutputStream() is used.
regds
-raju
20 years ago
Yes, when I was using my own exception class, the session is not getting timed out.
Thank you for ur suggestions.
Hi,
I am using Servlets and Stateful SessionBeans in my application. If I find any error in the sessionBean, I am catching it with an appropriate exception and throwing RemoteException. For Example there is a method called 'createUser' as follows:
public int createUser (String uname) throws RemoteException {
try {
.....
.....
......
} catch (FinderException fe) {
fe.printStackTrace();
throw new RemoteException ("Create User Failed: " + fe.getMessage(), fe);
} catch (NullPointerException npe) {
npe.printStackTrace();
throw new RemoteException ("Create User Failed: " + npe.getMessage(), npe);
} catch (DuplicateKeyException dke) {
dke.printStackTrace();
throw new RemoteException ("Create User Failed: " + dke.getMessage(), dke);
}
}
The intention here is to throw proper error messages to a servlet. In the Servlet I am catching RemoteException to show the error messages on a webpage as follows:
protected void doCreateUser (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try {
.....
.....
} catch (RemoteException rex) {
rex.printStackTrace();
errorPage(rex.getMessage()); // To show the errors on a webpage
}
}
Till now it is fine. When I am trying to access the session next time, it says
java.rmi.NoSuchObjectException: Session has timed out at com.evermind.server.ejb.StatefulSessionEJBObject.throwPassivisationException(StatefulSessionEJBObject.java:215)
at qReportSession_StatefulSessionBeanWrapper10.getRecordTypes(qReportSession_StatefulSessionBeanWrapper10.java:419)
at qtweb.qtReportServ.onRecTypeForm(qtReportServ.java:1648)
at qtweb.qtReportServ.doGet(qtReportServ.java:105)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:195)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:309)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:684)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:269)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:735)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:243)
at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)
How do I make sure that session is not timedout when the session bean throws an exception.
I am accessing the session bean methods using remote inteface. First lookup for the home inteface and create a remote interface.
How to check whether a session bean is getting passivated or not?
Thanks and regds
-raju
Hi,
I am using Jdeveloper 9.0.2, Windows 2000 Professional, Oracle 8.1.6 database. My application consists of servlets, stateful session beans, and entity beans. When ever I get an exception in the stateful session bean I am catching it and throwing it to the servlet to display proper error messages. But once a session bean throws an exception, and after that if servlet trys to connect to the session bean I am getting the following error.


Actually I catching the appropriate exception in the session bean and throwing 'RemoteException' again in the servlet I am catching 'RemoteException' to display the error message.

How to keep the sesssion alive even if a session bean throws an exception.
Hi,
I am using oracle9i jdeveloper 9.0.3,
I have downloaded jdev903_pre and uziped and executed jdevw.
I had created a simple session bean (TSession) and to test it a client has been created. The source code is as follows:
package Samplemypackage1;
import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
import mypackage1.TSession;
import mypackage1.TSessionHome;
import javax.naming.NamingException;
public class TSessionClient
{
public static void main(String [] args)
{
TSessionClient tSessionClient = new TSessionClient();
try
{
Context context = getInitialContext();
TSessionHome tSessionHome = (TSessionHome)PortableRemoteObject.narrow(context.lookup("TSession"), TSessionHome.class);
TSession tSession;
// Use one of the create() methods below to create a new instance
// tSession = tSessionHome.create( );
tSession = tSessionHome.create();

// Call any of the Remote methods below to access the EJB
// tSession.PrintGiven( java.lang.String str );
tSession.PrintGiven("raju");
}
catch(Throwable ex)
{
ex.printStackTrace();
}
}
private static Context getInitialContext() throws NamingException
{
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
env.put(Context.SECURITY_PRINCIPAL, "admin");
env.put(Context.SECURITY_CREDENTIALS, "welcome");
env.put(Context.PROVIDER_URL, "ormi://localhost:23891/current-workspace-app");
return new InitialContext(env);
}
}
When I run this code I got the following error message.
javax.naming.NamingException: Lookup error: java.net.ConnectException: Connection refused: connect; nested exception is:
java.net.ConnectException: Connection refused: connect
java.lang.Object com.evermind.server.rmi.RMIContext.lookup(java.lang.String)
RMIContext.java:134
java.lang.Object javax.naming.InitialContext.lookup(java.lang.String)
InitialContext.java:350
void Samplemypackage1.TSessionClient.main(java.lang.String[])
TSessionClient.java:18
Process exited with exit code 0.
Any Idea how to resolve this error? Do I need set any environment variables before developing ejbs?
regds
-raju
21 years ago
Hi I am using JDeveloper 9.0.2, JBoss 3.0.0 and Tomcat 4.0.3 and using Oracle as a datasource. I have developed a simple container managed entity bean with tables in JDeveloper. The finder methods are managed by OC4J. Now how to deploy the bean to JBoss.
regds
-raju
21 years ago
Hi,
I am using JDeveloper 9.0.2 and JBoss 3.0.0 and Tomcat 4.0.3 and Oracle as my datasource. I have developed a sample entity bean in JDeveloper using container managed entity beans from tables. The finder methods are managed by OC4J. How to deploy the the bean to JBoss.