Re: How to send hidden variables to next page

2005-02-25 Thread David da Guia Carvalho
I dont know but looks like you are doing somethings wrong... hidden
fildes are a great choice... better them use GET method...
About the table think... use Iframe and do a submit to it...
Whem you submit you use normal submit button or javascript???
If you are submiting with normal button try to use Javascript is much
better! Example:

!-- AT HEADER --
script language=javascript
function submitform()
{
// FOR LOCAL FORM... where the form name is myform
document.myform.submit();

//OR FOR IFRAME FORM... where the IFRAME name is myframe and the FORM
name is myform1
window.frames.myframe.document.myform1.submit();

}
/script
!-- AT BODY
The link to submit:
--
A HREF=javascript: submitform()SUBMIT HERE!!!/A

You can also make MANY variations on it... like pass values in the
function from the external frame to a filed on iframe.
Example:

!-- AT HEADER --
script language=javascript
function submitform(val1)
{
//CHANGE THE VALUE OF A FIELD ON IFRAME... where myfield is the name of
the filed...
window.frames.myframe.document.myform1.myfield.value=val1;
//FOR IFRAME FORM... where the IFRAME name is myframe and the FORM name
is myform1
window.frames.myframe.document.myform1.submit();
}
/script

!-- AT BODY --
A HREF=javascript: submitform(VALUEOFF1)SUBMIT HERE/A

I make some dynamic tables based on users choies! Works very well.

Best Regards,

--

David da Guia Carvalho
Animus Tecnologia da Informao
Tel.: (21) 3525-8800
Fax: (21) 3525-8801
http://www.animus-ti.com.br


On Feb 25, 2005 03:44 AM, U K Laxmi [EMAIL PROTECTED] wrote:

Thanks David for the info. Sure to do some reading. I
could able to pass the hidden variables to next page.
It's just i'm using one hidden variable named
'package' which was doing all the problem. I just
changed it to something else and now it's working.

Still table issue not solved. I'm gooling ... for the
solution.

--- David Smith [EMAIL PROTECTED] wrote:

This is getting into territory where you'd be better
off doing some
googling or buying a good javascript cookbook. I
havn't bought any of
those books recently although I've had good
experience with subjects
from Wrox Publishing and O'Reilly Associates in the
past. Visit
Amazon. They even support a rating scheme where
people can voice their
opinion.

On the Delete issue, you could do a server-side
rewrite of a link that
invokes an action to delete a row as in:
a

href=http://localhost:8080/mywebapp/deleteRow.do?recordNum=10;Delete

Me/a

That's just a basic GET form request.

Again, find a good book, do some reading.

--David

U K Laxmi wrote:

Thanks David for the solution. To be frank, i
really
don't know how to code it. Will you give a sample
code
snippet? I'm using apache2, tomcat 5.5.7 on Win 2K
machine.

One more problem. I've a form and also submit
button.
I've number of text fields in it. On entering some
data and focus losts from that field, i call a
javascript function, i set number of hidden values
and
call a JSP using location.href of Javascript. But
hidden values are not getting passed to jsp.I'm
getting null. Why? How to overcome this? Pls help.

One more requirement what i've is:
i'VE A FORM WITH FORM ELEMENTS IN IT AND A 'aDD'
BUTTON. After filling theform, if the user clicks
on
'Add' button, the contents gets added aas row into
a
HTML table located below that form. That way user
can
add n number of rows to the bottom table. In the
table, i need a 'Delete' button. After selecting
any
row, if the user clicks on 'Delete' button, it
should
get deleted from the table. I guess it can be
possible. But it's a big challenge to me as i know
only ABCD of HTML  Javascript.

If anybody can direct me to a good HTML/Javascritp
forum also fine. If i get a solution directly, it's
wonderful.

Thanks a lot. Sorry again if it's not the right
place
to post this.


--- David Smith [EMAIL PROTECTED] wrote:



The best advice I can offer -- have a javascript
that does the submit
for you on the event the drop-down changes state.
Then let a servlet
handle storing your form data in the session and
passing updated data to
the next page. Outside of something like that, I
think you'll need to
incorporate a submit button.

--David

U K Laxmi wrote:



Thanks for the answers Shakeel.

My problem is, i've a page that doesn't have
submit
button. I need to send the hidden variables in
that
HTML page to next HTML page. Here the hidden
value


is


set based on the type of option selected from


'select'


drpo down box in HTML. To put it in session, i
need


to


identify the selected option and assign it to
java
varialbe. I don't think it's possible to assign a
javascript variable to java variable. Pls help to
solve this problem.


--- Shakeel Ahmad [EMAIL PROTECTED]


wrote:






Wel this might help...

// You write following two lines in first JSP


page.


String name = Java;// This might be your
hidden
field.
session.setAttribute(HiddenName, name

Reload aplication

2005-02-15 Thread David da Guia Carvalho
Hi,

I would like to allow users reload especific aplications with a
expecific users and roles.
I dont whant to allow access direct to the manager page... (because user
could be able to reload and undeploy any aplication!)
There is any way to do this... (Sorry by this question but Im new in
tomcat world!)
Any recommended docs???

Best Regards,

--

David da Guia Carvalho
Animus Tecnologia da Informao
Tel.: (21) 3525-8800
Fax: (21) 3525-8801
http://www.animus-ti.com.br




RE: servlet help

2005-01-12 Thread David da Guia Carvalho
Configurando Apache + Jakarta-TOMCAT + Connector MOD_JKConfigurando
Apache + Jakarta-TOMCAT + Connector MOD_JKHi... follow down the
mini-howto (Unfortunely I write in portuguese so I have to make a
translation...) I will work on it to translante and correct some
issues... perhaps even in portuguese he can help you

When I finish the translation I post to you again... (if you need any
help to especific parts mail me!)


Configurando Apache + Jakarta-TOMCAT + Connector MOD_JK
Por: David da Guia Carvalho
Data: 09-09-2004


Consideramos que o leitor possua o seguinte ambiente:
Apache 1.3 ou 2.0; (+DEVEL) + APXS;
J2SDK 1.4;
Jakarta-Tomcat 5.0;
GCC, G++ e DEVEL (LIBS e HEADERS);


Conveo do tutorial:
Letras em Itlico so utilizadas para comandos de Shell;
Letras em courier so utilizadas em contedo de arquivos;


Este mtodo foi utilizado repetidamente em DEBIAN 3.0 e Conectiva 10
(Redhat like).
(ambos atualizados na data (09-09-2004)).


APACHE:


A instalao do Apache padro da distribuio:


Debian: Server version Apache/1.3.26 (Unix) Debian GNU/Linux
nenhuma modificao.


Conectiva: Server Apache/2.0.49
(A nica modificao feito foi no arquivo /etc/apache/conf/httpd.conf em
DocummentRoot por motivos de padronizao.)
De:
DocumentRoot=/srv/www/default/html
Para:
DocumentRoot=/var/www


( ESTA MODIFICAO NO INFLUENCIA NO FUNCIONAMENTO DO APACHE + TOMCAT )


O JSDK e JAKARTA-TOMCAT:


Em ambas as distribuies instalamos JSDK e TOMCAT em /opt.
No arquivo /etc/profile foram colocadas as seguintes variveis que
indicam onde estas aplicaes foram instaladas segue abaixo um exemplo:


JAVA_HOME=/opt/j2sdk1.4.2_05
JRE_HOME=/opt/j2sdk1.4.2_05/jre
TOMCAT_HOME=/opt/jakarta-tomcat-5.0.27
export JAVA_HOME
export JRE_HOME
export TOMCAT


Os COMPILADORES:


GCC, G++, LIBS e DEVELS foram instalados segundo o padro da
distribuio (instalao via apt-get)


Introduo:


Onde obter o arquivo?
Baixe o arquivo: jakarta-tomcat-connectors-jk-1.2.6.src.tar.gz

(http://archieve.apache.org/dist/jakarta/tomcat-connectors/jk/source/jakarta-tomcat-connectors-jk-1.2.6-src.tar.gv)


Instalao:


Descompacte-o em uma pasta de sua escolha (no nosso exemplo utilizaremos
/usr/src)


#tar -zxvf jakarta-tomcat-connectors-jk-1.2.6-src.tar.gz


Entre na pasta que foi criada.


#cd /usr/src/jakarta-tomcat-connectors-jk-1.2.6-src/jk/native


dentrodo diretorio inicie os preparos para a compilao:


#./configure with-apxs=/usr/sbin/apxs


(
Caso necessario o diretorio do apxs pode ser localizado com o comando:
#locate apxs


Caso nunca tenha utilizado o comando locate atualize suas bases de
dadods com o comando:
#updatedb
)


Aps conseguir executar o configure com sucesso execute o comando
make:


#make 


aps o comando make copie o arquivo gerado para o diretorio de mdulos
do apache (isso varia de distribuio).




PARA DEBIAN 3.0:


#cp
/usr/src/jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.so.0.0.0
/usr/lib/apache/1.3/mod_jk.so


PARA CONECTIVA 10:
#cp /usr/src/jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.so
/usr/lib/apache/modules


Configurando o Apache:


No diretorio conf (para Debian: /etc/apache para Conectiva:
/etc/apache/conf/) do apache, edite o arquivo httpd.conf


Na seo LoadModule adicione as seguintes linhas:


PARA DEBIAN:


##
### Java ###
### TOMCAT ###
##
LoadFile /usr/lib/libpthread.so
LoadModule jk_module /usr/lib/apache/1.3/mod_jk.so
#AddModule mod_jk.c
JkWorkersFile /opt/jakarta-tomcat-5.0.28/conf/workers.properties
JkLogFile /var/log/apache/mod_jk.log
JkLogLevel debug
JkLogStampFormat [%a %b %d %H:%M:%S %Y] 
JkRequestLogFormat %w %V %T
#
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
# send all requests ending in .jsp to
# JkMount /*.jsp worker1
# send all requests ending /servlet to worker1
# JkMount /*/servlet/ worker1
# send all requests jsp requests to files located in /otherworker will
go worker2
# JkMount /otherworker/*.jsp worker2


#






Para CONECTIVA:


##
### JAVA ###
### TOMCAT ###
##
#LoadFile /usr/lib/libpthread.so
LoadModule jk_module /usr/lib/apache/modules/mod_jk.so
# AddModule mod_jk.c
JkWorkersFile /opt/jakarta-tomcat-5.0.27/conf/workers.properties
JkLogFile /var/log/apache/mod_jk.log
JkLogLevel debug
JkLogStampFormat [%a %b %d %H:%M:%S %Y] 
JkRequestLogFormat %w %V %T
#
JkMount /*.jsp ajp13
# send all requests ending in .jsp to
# JkMount /*.jsp worker1
# send all requests ending /servlet to worker1
# JkMount /*/servlet/ worker1
# send all requests jsp requests to files located in /otherworker will
go worker2
# JkMount /otherworker/*.jsp worker2
#


No final do arquivo httpd.conf (tanto p/ conectiva quanto p/ debian)
adicione:


Alias /jsp-examples \
/opt/jakarta-tomcat-5.0.27/webapps/jsp-examples


Configurando o TOMCAT:


Edite (criar caso no exista) o arquivo:
/opt/jakarta-tomcat-5.0.27/conf/worker.properties inserir o seguinte
conteudo

Users Rigths

2005-01-07 Thread David da Guia Carvalho
Hi,
   I'm new in tomcat and Java.
   I search at the archives and do some google but I dont find any think
like that...
   I would like to create a user at tomcat with the rights like to
deploy remotely and reload their aplication... but ONLY their own
aplication and dont have access to the global manarger or admin.
(Kind a especific manager and admin per aplication... if possible even a
restricted set of tools)
  I dont know if I'm going to the wrong direction... and tips are very
welcome...

Best regards,

--

David da Guia Carvalho
Animus Tecnologia da Informação
Tel.: (21) 3525-8800
Fax: (21) 3525-8801
http://www.animus-ti.com.br