Como acessar um jsp via laszlo ? SOCORROOOOO

3 respostas
H

Olá amigos, estou com um problema com o laszlo. To na peia já fazem dois dias…SOCORRO putz to doido já.

Estou usando struts 1.2 ok.

Entao fiz meus mapeamentos tudo certinho testei o link e ele esta funfando legal.

Bem meu problema.

Eu tenho os seguintes arquivos

menu.lzx

<?xml version="1.0" encoding="UTF-8"?> <!-- ====================================================================== Jan 30, 2007 6:09:11 PM handerson.frota ====================================================================== --> <canvas debug="true" height="230"> <debug y="100"/> <include href="libaryMenu.lzx"/> </canvas>

alert.lzx

<?xml version="1.0" encoding="UTF-8"?>
<!-- ====================================================================== 
     Jan 31, 2007 4:36:05 PM                                                        
     handerson.frota                                                                
     ====================================================================== -->
<canvas>
    <include href="../libaryMenu.lzx" />
	<window x="20" y="20" width="200" height="250" title="Simple Window" resizable="true">
	    <text>Componente alert</text>
	</window>
</canvas>

libaryMenu.lzx

<library>
  <debug y="100"/>
	<menubar width="200">
	    <menu text="Componentes" width="100">
	      <menuitem text="Alert" name="alert" onselect="canvas.acessa(this);"/>
	    </menu> 
 	</menubar>
	<dataset name="dsSend" trimwhitespace="true" request="false" 
          		type="http"/>
          		
  <method name="acessa" args="vThis">
  	if(vThis.text == "Alert"){
          	Debug.write(vThis.parent.owner.text + " - " + vThis.text);
			// local de comunicação
			dsSend.setSrc( 'http://127.0.0.1:8080/Laszlo/componente.do?method=alert');
			// solicita os dados do servidor
			dsSend.doRequest();
  	}
  </method>
</library>

Entao ele carrega tudo direitinho e tal, mais quando clico na opcao do menu que é o ALERT ele nao carrega meu jsp.
Ele entra na minha action, tudo certinho, mais nao abre meu jsp.

ComponentesAction

public ActionForward alert(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {

		request.setAttribute("vComponente", "alert");
		
		return  mapping.findForward("componentes");
}

Meu jsp que eu quero que ele carregue eh esse…

<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<html>
  <head>
	
  </head>
  
<body bottommargin="0" leftmargin="0" rightmargin="0" topmargin="0">
<logic:equal name="vComponente" value="alert">
  <object 
 			type="application/x-shockwave-flash" 
 			data="laszlo/componentes/alert.lzx?lzt=swf" 
 			width="100%" height="100%">
        	<param name="movie" value="laszlo/componentes/alert.lzx?lzt=swf">
			<param name="quality" value="high">
			<param name="scale" value="noscale">
			<param name="salign" value="LT">
			<param name="menu" value="false">
	</object>
</logic:equal>	
  </body>
</html>

Ele acessa o meu metodo alert da minha action certinho, so que ele nao faz NADA, ele nao carrega.

A pergunta então é

Eu posso carregar um JSP via Laszlo ?
E como faço ?
Eu queria algo como um link entende, eu quero clicar e ele vai para a minha action que carrega um JSP e neste tem uma chamada para o meu arquivo lzx do laszlo.

Me ajudem por favor.
Aguardo resposta e obrigado.

3 Respostas

H

Bem o que eu consegui foi algo como

<menubar width="200">
	    <menu text="Componentes" width="100">
	      <menuitem name="alert">
	      		<text><a href="componente.do?method=alert">Alert</a></text>
	      </menuitem>
	    </menu> 
</menubar>

rapaz e neh que ta funcionando, bem mais acho que existe outra maneira mais “LIMPA” pq acho que isso eh uma gambiarra neh…então alguem me ajuda ?

Obrigado.

E

tem sim…

utilizando o LzBrowser veja o link :wink:

[]'s

H

Opa cara vlw :smiley: melhor que text :smiley:

Criado 31 de janeiro de 2007
Ultima resposta 1 de fev. de 2007
Respostas 3
Participantes 2