[Logo] Mentawai Forum - Mentawai Web Framework
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 

Forum Read-Only! Check the new site and forum here!

34) Executando comandos do SO.  XML
Forum Index -> F.A.Q.
Author Message
Lobo


[Avatar]

Joined: 23/01/2006 02:17:14
Messages: 840
Location: Fortaleza-CE
Offline

Code:
 public class MinhaAction extends BaseAction {
 
 	public String execute() throws Exception {
 		
 		ExecUtil.execLinux("firefox");
 		
 		ExecUtil.execLinux("thunderbird");
 		
 		ExecUtil.execLinux("xpdf");
 		
 		return SUCCESS;
 	}
 	
 }
 


Resultado do comando procinfo no linux:

Code:
 
 public class WatchAction extends BaseAction {
 
 	public String execute() throws Exception {
 		
 		output.setValue("procinfo", ExecUtil.execLinux("procinfo"));
 		
 		return SUCCESS;
 	}
 	
 }
 


jsp:

Code:
 <%@ taglib uri="/WEB-INF/lib/mentawai.jar" prefix="mtw" %>
 <html>
 <head>
 <title>PROCINFO</title>
 <mtw:noCache />
 </head>
 <body>
 
    <mtw:out value="procinfo" />
 
 </body>
 </html>
 


resultado :


Linux 2.6.29.6-smp (root@midas) (gcc [can't parse]) #??? 2CPU [lobometal] Memory: Total Used Free Shared Buffers Mem: 2060664 1242896 817768 0 1100 Swap: 498004 0 498004 Bootup: Wed Dec 16 18:13:47 2009 Load average: 0.62 0.33 0.22 4/206 8967 user : 0:06:15.03 4.0% page in : 0 nice : 0:00:00.00 0.0% page out: 0 system: 0:01:02.49 0.7% swap in : 0 idle : 2:24:50.11 94.1% swap out: 0 uptime: 1:16:57.23 context : 5013077 irq 0: 124 timer irq 16: 131957 i915@pci:0000:00:02. irq 1: 13048 i8042 irq 17: 0 uhci_hcd:usb3 irq 4: 2 irq 18: 104142 uhci_hcd:usb4 irq 7: 0 parport0 irq 19: 157 uhci_hcd:usb5, HDA I irq 8: 1 rtc0 irq 20: 27606 ehci_hcd:usb1, uhci_ irq 9: 0 acpi irq 23: 83119 ata_piix irq 14: 0 ide0 irq 26: 47404 0 PCI-MSI-edge irq 15: 0 ide1
 


Essa facilidade já existe desde a versão 1.14.1
http://www.mentaframework.org/changes/changes_1.14_pt.txt

Agora com suporte a chamar comandos do linux também.

Atenciosamente,
Hélio Frota

Helio Frota
10+ Java Programmer
heliofrota.com

Member
Mentawai Developer
 
Forum Index -> F.A.Q.
Go to:   
Powered by JForum 2.1.6 © JForum Team