Sign in to follow this  

How I Do Get Return Value From My Server On Struts Environment

Recommended Posts



I am using FusionWidget specially Real-time graph.


These day, I set on Real-time graph on my tomcat 7 server.


When I run example code on Documents in official FusionWidget homepage, I can see graph but It doesn't update itself.


HTML page as below.




<TITLE>FusionWidgets v3 - Multiple dataset example</TITLE>

<script type="text/javascript" src="../Charts/FusionCharts.js"></script>




<div id="chart1div">

This text is replaced by the Flash movie.


<script type="text/javascript">

var chart1 = new FusionCharts("../Charts/RealTimeLine.swf", "ChId1", "900", "350", "0", "0");










<chart caption='CPU Usage' subCaption='Grape for CPU Usage' dataStreamURL='GetCPU.action' refreshInterval='2' setAdaptiveYMin='1' xAxisName='Time' showRealTimeValue='1' labelDisplay='Rotate' slantLabels='1' numDisplaySets='20'>


<dataset seriesName='CPU' showValues='0'>






<style type='font' name='captionFont' size='14' />



<apply toObject='Caption' styles='captionFont' />

<apply toObject='Realtimevalue' styles='captionFont' />






partion of struts.xml



<package name="notice" extends="struts-default">



<result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult"/>



<action name="GetCPU" class="com.information.GetCPUAction">

<interceptor-ref name="prepare"/>

<interceptor-ref name="modelDriven"/>

<interceptor-ref name="params"/>

<result name="success">./Result/NewFile.jsp</result>











<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%><%@ taglib prefix="s" uri="/struts-tags" %>&label=<s:property value="time"/>&value=<s:property value="cpu"/>









Because I running this page on Tomcat 7 with Struts 2, I set dataStreamURL like that.


Moreover, I already check that com.information.GetCPUAction.class was running after "GetCPU.action"


When I input "GetCPU.action" on my browser, I can see "&label=10:34:12&value=71.98".


It is perfectly same as that default JSP result


When I changed dataStreamURL like "xxxx.jsp", it worked!


Why Chart can not update this data? Could you help me?






1. I can saw graph from loading Control.html, but It doesn't update data


2. I checked that graph call GetCPU.action and associated class was runing.


3. And I can see return data value on my browser by inputing rawURL




Edited by Scorcher

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this