lokesh reddy

Ranch Hand
+ Follow
since Sep 15, 2000
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by lokesh reddy

Hi Jessi,
I think you dint got the problem completely. Pl have a look at the bold letters in the question and let met know your opinion.
I want to use only one action form to handle both the events. I am using DynaValidatorForm here he is talking about one action form handling two different actions and not two submit buttons handling one single action. And also the problem is with handling validations in the actionform i hope so.
Loke .
---------------
I am never afraid of tommorow, since i saw yesterday and i love today.
21 years ago
Hi,
By default jboss doesn't support webservices. I mean to say still jboss doesnt have built in support for webservices.
We have to use Cysive Cymbio� server on jboss to enable webservices. And Cysive Cymbio server is not freeware
To know more details about Cysive Cymbio� visit https://secure.cysive.com/devzone/RequestEvaluation
I hope you find this info useful
Loke.
21 years ago
Hi,
It seems that you defined home and remote interfaces in ejb.interfaces package and bean implementation in ejb.client package which is why you are getting the
-------------------------------------------------
15:01:22,981 WARN [ServiceController] Problem creating service jboss.j2ee:jndiName=Hello,service=EJB
java.lang.ClassNotFoundException: ejb.interfaces.HelloWorldHome
at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
--------------------------------------------------
error. and regarding
--------------------------------------------------
Bean : Hello
Section: 16.2
Warning: The Bean Provider must specify the fully-qualified name of the enterprise bean's home interface in the home element.
15:01:22,887 INFO [EJBDeployer]
Bean : Hello
Section: 16.2
Warning: The Bean Provider must specify the fully-qualified name of the enterprise bean's remote interface in the remote element.
--------------------------------------------------
errors you just open your ejb-jar.xml file and change <home>HelloHome</home> to <home>ejb.interfaces.HelloHome</home> and <remote>Hello</remote> to <remote>ejb.interfaces.Hello</remoet>

I hope you find this info useful
Loke.
21 years ago
Hi Suji,
Here i am providing a simple example for your convenience.....

1) Define a class which extends from ArrayList as follows.
import java.util.*;
public class ComboFields extends ArrayList
{
public ComboFields()
{
//Connect to the database and get results
from resultset here using jdbc//
add("option1");
add("option2");
add("option3");
}
}
compile this class and use this class as a bean in jsp page under session scope as follows.
<jsp:useBean id="beanOptions" scope="session" class="ComboFields"/>
and you can use this bean id while defining html:select tag which looks like as follows.
<html:select property="holdValue">
<html ptions name="beanOptions"/>
</html:select>
where property attribute in html:select is a member of actionform which you will be writing to submit the values with in this form. And also note the "beanOptions" name used in the html ptions attribute is the bean id name which we created in the beginning.
I hope you find this info useful.
Loke.
21 years ago
Hi Ashish,
In your action class after performing your business logic, you can add the following code to make the fields on the form empty.
if(form instanceof DynaForm)
{
DynaForm f=(DynaForm)form;
f.setInput1("");
f.setInput2("");
}
setInput1 and setInput2 methods reflects the variable and methods defined in actionform class.
I hope you find this info useful.
Loke.
21 years ago
Hi Ashish,
You can define two action mappings in the struts-config.xml file which uses one action form.
So for the first tag you say validate=true and for another tag you say validate=false. If you specify validate=false then the validate method in action form does not execute.
For example
For submit button
-----------------
<action path="/submit" type="someclass" name="DynaValidateForm" validate="true" input="/xxx">
</action>
For back button
---------------
<action path="/back" type="someclass" name="DynaValidateForm" validate="false" input="/xxx">
</action>

I hope you find this info useful.
Loke.
21 years ago
Hi the following are the escape characters for & and #
& = %26
# = %23
Hope u find this info useful.
Loke.
22 years ago
Hello shan,
remove the ";" (terminator) after set CATALINA_HOME.
it should be like

set CATALINA_HOME=e:\tomcat\tomcat4
and not

set CATALINA_HOME=e:\tomcat\tomcat4;
also check if you have terminated the JAVA_HOME variable. if u have terminated it then remove the terminator for JAVA_HOME also.
i hope u find this info useful.
bye
loke.
22 years ago
Can u please paste the code u r using to connect to the sql server.
for example:
Class.forName("jdbc dbc:......");
Connection con=DriverManager.getConnection(.....)
and also please mention, what type of sql server u r trying to connect.
23 years ago
Hi Sanjeev,
Here i am providing some steps for u. I hope u will succed in running a servlet after following this steps.

Win 95/98/ME Environment
------------------------
open your autoexec.bat file and type the following.
1)set JAVA_HOME=<replace this with your java directory>
2)set TOMCAT_HOME=<replace this with your tomcat directory>
3)set classpath=<tomcat_directory>\lib\servlet.jar;<java_directory>\src.jar;<java_directory>\lib\tools.jar;
After editing the autoexec.bat file, restart your system such that the changes u made to the system in autoexec.bat will take effect to the os.
****************************************************************
Win NT/2000
-----------
Open Control Panel and Select System icon on it.
Here u can set the environment variables for the system.
Double click on the Classpath and add
<tomcat_directory>\lib\servlet.jar;<java_directory>\src.jar;<java_directory>\lib\tools.jar;
the above lines.
In winnt environment there is no need to restart the system.
***************************************************************
After successfully setting up the environment, u have to configure the tomcat server. But for now, to test whether the servlet is running or not, you can follow these steps.
1) Write a servlet.
2) Dont forget to put it in package.
3) This servlet should be placed in <tomcat_directory>\webapps\examples\WEB-INF\classes.
(dont worry, i will tell you how to map your own context instead of </examples> )
So, for example if you wrote a servlet called HelloWorld.java then the directory hierarchy should be as follows.
c:\tomcat\webapps\examples\WEB-INF\classes\Hello\HelloWorld.java
Note: Here Hello is a package name.
4) Compile the servlet from the same directory.
5)After successfully compiling the java file you have to map the servlet in the web.xml file.
Note: web.xml file is located under c:\tomcat\webapps\examples\WEB-INF directory.
6) Edit the file and there u have to type this lines.
<servlet>
<servlet-name>HelloWorld</servlet-name>
<servlet-class>Hello.HelloWorld</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>HelloWorld</servlet-name>
<url-pattern>/HelloWorld</url-pattern>
</servlet-mapping>
7)After making changes in web.xml file restart your tomcat server.
8) In the browser address type: http://localhost:8080/examples/HelloWorld
And thats it, you can find ur servlet running.
I hope u find this info useful.
Bye.
Loke.
23 years ago
Hi I am able to deploy the ejb on ubs 7.2 and i am able to run it successfully.
The findByPrimaryKey and the remaining methods are working fine. But when i tried to insert data using create method the ejb server is getting strucked and its not responding for a long time.
I am using MS SQL Server 2000 as my RDBMS, i have a doubt that there is some dead locking happening.
If any one faced this problem and had a solution please let me know.
Thanx.
Lokesh.
Hi All,
I am getting heard from many of my fens that XSP is much better than JSP. But i dint know much about XSP.
If any one knows about this technology, please let me know, what are the advantages of XSP over JSP and what is this new technology going to do??
Thanx in advance.
Loke.
23 years ago
Hi Gaurav,
There is nothing wrong with your program, the only mistake u have done is u r trying to get the parameter from the html page.
As maha anna said the initparameters can be initialized only once in a life cycle of servlet, and the initparameters must be supplied by a servlet engine.
If u r using tomcat then u have to use web.xml file and supply the init parameters in that file.
As u said u r using javawebserver 2.0 trial version, then u have to follow the following steps.
1) Start ur java webserver.
2) Open ur browser.
3) type http://localhost:9090 (This will open admin panel, if u r using this for the first time, then type admin as username and password).
4) Double click on web service. (This will open a dialog box)
5) Select Servlets button from the top.
6) Click on Add and enter ur servlet name and servlet class in the text fields and click ok.
7) Then ur servlet will be listed under configure (Which is under add).
8) Double Click on the servlet name (Under Configure)(This will open a dialog on right hand side).
9) Click on properties tab and click on add button.
10) Enter the parameter name and parameter value in the appropriate boxes.
Thats it u r done with supplying a init parameter to ur servlet.
I hope u find this info useful.
Bye.
Loke.
23 years ago
Hi Somasundaram,
The three functions which u were talking about are known as life cycle methods of jsp page.
You use the jspInit method to initialize any variables, and you use the jspDestroy method to free the resources ur jsp using. The service method is important and it is automatically generated by the jspcompiler. The service method contains all the translated code (The html,Scriptles,Directives e.t.c). So if u try to overwrite it, then ur program will not behave like what ur expecting from it.
I think u find this info useful.
Bye
Loke.
23 years ago
Hi gopi,
The jsp page by default is not thread safe, if u want to make it thread safe then you have add the following directive in your jsp page declaration.
<%@ page language="java" isThreadSafe=false%>
Dont think i have put isThreadSafe=false by mistake. You have to make it false, if u want to make ur jsp page thread safe. Bye default the attribute will be true.
If u want to find whats the reason behind it, then i would like to suggest you to go through the jsp specification.
I hope u find this info useful.
Bye.
Loke.
23 years ago