Anna Ferrari

Greenhorn
+ Follow
since Aug 18, 2006
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 Anna Ferrari

Hi,
probably you're right. I keep manifest like eclipse make it. But it isn't enought. Maybe I have to add a lot of tomcat jar files in the manifest class-path or launch the java class with a crazy mode. I don't like this solution. I thought this way more simple that what it really is.
I have to look for an other way. Probably I have to think something outside web application.
For now, thank you very much.
16 years ago
Hi,
unfortunately this dont't works. I make jar file from eclipse, manifest.mf is ok, but nothing, I have always : COULD NOT FIND MAIN CLASS.
16 years ago
Hi,
thank you very much, for your attention.
I'm very confused, therefor I decide to move off with an other code.
I take this code from :
web page

I change a little the code, because for example I don't find Deployer class in side my tomcat embedded version.
Here is the code (I think it is similar to the old) :



My intention is to make run my web application in side a pen drive.
I dowloaded Server2Go.exe and I put it in the pen drive because my app requires mysql.
I put tomcat-embedded version in the pen drive.
Now my problem is to make "some thing" to start a tomcat version (in side the pen) for open (with the browser) my web application.
My intention is to put the pen drive in an other PC and to launch my web appl.
Is it possible? Or is it an other way to do some thing like this?
Thanks.
[ November 26, 2007: Message edited by: Anna Ferrari ]
16 years ago
Hi,
first off all, sorry for my bad english. I try to lay out my problem.
I want to know if it is possible to run a web application without formally install and launch tomcat.
My existing web application works inside Tomcat.
I downloaded from internet a tomcat embedded version. After that, I created an eclipse project using a java source code downloaded.
My code Embed55.java uses following import :


In the eclipse project :

1) I created a user library with inside all jar file contained in ...\apache-tomcat-5.5.25-embed\lib
2) I copied (inside the project) from ..\apache-tomcat-5.5.25-embed the following directories :

3) I copied my web application gestlav (directory from my tomcat) inside of webapps.

That's all.
I run Embed55.java (FROM ECLIPSE) and inside eclipse console tomcat starts :

25-nov-2007 14.26.45 org.apache.catalina.startup.Embedded start
INFO: Starting tomcat server
25-nov-2007 14.26.46 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.25
.....
.....

I open browser and write : http:\\localhost:8080\gestlav\
and my web application starts.

If I make a jar file (with eclipse) and put it in C:\Embed.jar
when I click twice jar file I have : Could not find main class

Jar file contains:

pippo
Embed55.class
webapps
conf
META-INF
MANIFEST.MF


This is META-INF/MANIFEST.MF

after Main-Class it is one blank line
Please, why?
Thanks for your help.
[ November 25, 2007: Message edited by: Anna Ferrari ]
16 years ago
Hi,
I test a java class (source download from internet) within tomcat embedded (5.5.25). Inside Eclipse (3.2) my programm work fine. I make a jar file (with eclipse), but when I launch my application I have "Could not find main class".
(java version :1.6.0_03-b05)
Any idea?
Thanks.
[ November 24, 2007: Message edited by: Anna Ferrari ]
16 years ago
I use struts-console in eclipse and this gives me a little help.
17 years ago
Thank you Bear.

I revolve my problem in this mode in side init (ServletConfig config):

//super.init(config);

Is it also correct then over-riding the init() method ?

Bye and thanks.
17 years ago
Hi, Scott
and thanks for your suggestion.
With debug I see :
x.openDBase(null, null, null, null).
Because this don't work :

driv=config.getInitParameter("driv");
url=config.getInitParameter("url");
usr=config.getInitParameter("usr");
pas=config.getInitParameter("pas");

Why?
How can I do?
Thanks.
17 years ago
Hi,

this is my situation:

web.xml

<context-param>
<param-name>driv</param-name>
<param-value>org.gjt.mm.mysql.Driver</param-value>
</context-param>
<context-param>
<param-name>url</param-name>
<param-value>jdbc:mysql://localhost/RM_archit</param-value>
</context-param>
<context-param>
<param-name>usr</param-name>
<param-value>java</param-value>
</context-param>
<context-param>
<param-name>pas</param-name>
<param-value>java</param-value>
</context-param>


servlet:

public class SrvMenu extends HttpServlet {


String driv=null;
String url=null;
String usr=null;
String pas=null;

public void init (ServletConfig config) throws ServletException {
super.init(config);
driv=config.getInitParameter("driv");
url=config.getInitParameter("url");
usr=config.getInitParameter("usr");
pas=config.getInitParameter("pas");
}



public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {

.....
.....
myconn=x.openDBase(driv, url, usr, pas);
.....

I call servlet but don't work, and worse yet my computer overheats (in task manager windows: java.exe goes 99% CPU and javaw.exe goes also up)
(For information I use Jboss 4.0.2, java 1.5).
Any suggestion?

Thanks in advance.
17 years ago
Hi,
I resolve my problem doing like this:

<SCRIPT LANGUAGE="JavaScript">
function indirizziCliente(id){
var str="<html:rewrite page='/indgest.do?do=ricerca&id=" + id + "'/>";
window.open(str,'','width=500,height=400,top=100,left=700');
}
</script>

Bye.
17 years ago
Hi,
thanks Merrill, but the value in side session attribute "cl" isn't correct.
If user selects the customer by clicking the link

<a href="javascript:indirizziCliente
(<bean:write name="cliente" property="id"/>">

the parameter "id" in side the function:

function indirizziCliente(id){

window.open('<html:rewrite page='/indgest.do?do=ricerca'/>',
'','width=500,height=400,top=100,left=700');
}

is the customer code's to use like primary key in side the following action "indgest.do?do=ricerca". That action display a list of shipment address of the customer "id".

I need to pass the customer's id select from the user and display the list with a pop up window.
How can I do?

Thanks in advance.
17 years ago
Hi,
I have this situation:



My problem is : how can I change "new Integer(1)" in javascript function with <bean:write name="cliente" property="id"/> ?
[ September 07, 2006: Message edited by: Merrill Higginson ]
17 years ago
Thank you Merrill Higginson for your answer, I take inspiration from you to resolve my problem and then i do like this:

In the first jsp i create three session's attributes :

<SCRIPT LANGUAGE="JavaScript">
function ricercaArticolo(){
<% session.setAttribute("bf", "movimentoBeanForm");
session.setAttribute("f1", "moarid");
session.setAttribute("f2", "moaridDesc");
%>
window.open('<html:rewrite page='/artgest.do?do=ricerca'/>',
'','width=500,height=400,top=100,left=700');
}
</script


And in the second I use those three session's attributes :

<SCRIPT LANGUAGE="JavaScript">
function sendValue(arId, arcodi){
window.opener.document.<%= session.getAttribute("bf") %>.
<%= session.getAttribute("f1") %>.value = arId;
window.opener.document.<%= session.getAttribute("bf") %>.
<%= session.getAttribute("f2") %>.value = arcodi;
window.close();
}
</script>

I think this is one step on, again thanks.Bye.
17 years ago
Hi,
from my first jsp I call with javascript another jsp for select one item from a table,the second jsp update two attribute in the first one jsp. My problem is that :I desire to re-use the second jsp in many situations, but with my code i can't.

This is the first jsp :

.....

<tr>
<td>Articolo</td>
<td><html:text property="moaridDesc" /></td>
<td><html:hidden property="moarid" /></td>
<td><html:input type="button" name="choise"
onKlick="window.open('<thtml:rewrite page='/artgest.do?do=ricerca'/>', ' ', width=500,height=400, top=100, left=700');" value="Ricerca"></td>
</tr>
......

This is the second jsp :

.....

<SCRIPT language="Javascript">

function sendValue(arId, arcodi) {
window.opener.document.movimentoBeanForm.moarid.value=arId;
window.opener.document.movimentoBeanForm.moaridDesc.value=arcodi;window.close();
}

.....


<logic:interate name="articoloBeanForm" property="articoloDOL" id="articolo" >
<tr>
<td>
<a href='javascript nKlick=sendValue(<bean:write name="articolo" property="arId" />,
"<bean:write name="articolo" property="arcodi" /> ")'>
<bean:write name="articolo" property="arcodi" /> </a>
</td>
</tr>
.......

The application works well, but the code inside sendValue reports only to movimentoBeanForm.
Any idea for resolve the problem?
Thanks.
17 years ago