Help needed in tiles-defs.xml
Hi,
I have a problem with my application, i have 2 seperate actions which have the following mappings in struts-config.xml
<action
attribute="memberinformationextractionForm"
input="/meminfo.do?gotoaction=info"
name="memberinformationextractionForm"
scope="request"
path="/memberinformationextraction" type="com.cisco.ciseclub.Admin.action.MemberinformationextractionAction">
<forward name="success" path="doc.mainLayout" />
<forward name="success1" path="doc.mainLayout" />
<forward name="systemfailure" path="doc.mainLayout" />
</action>
<action
attribute="corpinfoextractionForm"
input="/jsp/corpinfoextraction.jsp"
name="corpinfoextractionForm"
scope="request"
path="/displaymeminfo"
type="com.cisco.ciseclub.Admin.action.CorpdomainentAction">
<forward name="success" path="/jsp/extracteddata.jsp" />
<forward name="failure" path="doc.mainLayout" />
<forward name="systemfailure" path="doc.mainLayout" />
</action>
In tiles-defs.xml i have the following code:
<definition name="doc.mainLayout" path="/jsp/Layout/homePage.jsp">
<put name="info" value="/jsp/memberinformationextraction.jsp" />
<put name="corpinfo" value="/jsp/corpinfoextraction.jsp" />
Now the problem i am facing is after doing the validation in the form when some wrong data is entered in memberinformationextraction.jsp ,it returns back to the jsp,then it is showing both the jsps memberinformationextraction as well as corpinfoextraction one below the other.
Please can somebody reply back as to why this is happening, could it be because i have "info" is there in both the definitions, in that case i even have other jsps in the tiles xml with name as meminfo and addinfo.
It might be a crossdomain.xml problem.
Please make sure that the server hosting the xml allows the domain where the swf is hosted.
You can start with:
<?xml version="1.0" encoding="utf-8" ?>
<cross-domain-policy>
<allow-access-from domain="*"/>
<site-control permitted-cross-domain-policies="master-only"/>
</cross-domain-policy>
Similar Messages
-
SEVERE: null : Can't find file '/WEB-INF/tiles-defs.xml'
I'm trying to get Tiles to work with Struts on my server. I'm running a local instance of Tomcat v5.5. Development environment is Eclipse. I"ve looked everywhere on the web and can't find any solutions that work. I've been working on this for several days now. It shouldn't be this hard...
I appreciate any help or suggestions people might have. I would really like to get beyond the configuration $#!^ and start coding.
Thanks in advance!!!
Jim
Here are snippets from the pertinent files:
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>
admin</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>
org.apache.struts.action.ActionServlet
</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<jsp-config>
<taglib>
<taglib-uri>struts-bean</taglib-uri>
<taglib-location>/WEB-INF/tlds/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>struts-logic</taglib-uri>
<taglib-location>/WEB-INF/tlds/struts-logic.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>struts-html</taglib-uri>
<taglib-location>/WEB-INF/tlds/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>struts-tiles</taglib-uri>
<taglib-location>/WEB-INF/tlds/struts-tiles.tld</taglib-location>
</taglib>
<!-- The following tag library info was added for JSTL libraries. -->
<taglib>
<taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri>
<taglib-location>/WEB-INF/tlds/fmt.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/fmt-rt</taglib-uri>
<taglib-location>/WEB-INF/tlds/fmt-rt.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/tlds/c.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/core-rt</taglib-uri>
<taglib-location>/WEB-INF/tlds/c-rt.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/sql</taglib-uri>
<taglib-location>/WEB-INF/tlds/sql.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/sql-rt</taglib-uri>
<taglib-location>/WEB-INF/tlds/sql-rt.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/x</taglib-uri>
<taglib-location>/WEB-INF/tlds/x.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jstl/x-rt</taglib-uri>
<taglib-location>/WEB-INF/tlds/x-rt.tld</taglib-location>
</taglib>
</jsp-config>
</web-app>
struts-config.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
"/WEB-INF/dtds/struts-config_1_2.dtd">
<struts-config>
<!-- ============================================ Data Source Configuration -->
<data-sources />
<!-- ================================================ Form Bean Definitions -->
<form-beans>
</form-beans>
<!-- ========================================= Global Exception Definitions -->
<global-exceptions />
<!-- =========================================== Global Forward Definitions -->
<global-forwards />
<!-- =========================================== Action Mapping Definitions -->
<action-mappings>
<action path="/foobar" forward="/createAccount.jsp" />
</action-mappings>
<!--
============================================= Controller Configuration
<controller contentType="text/html; charset=UTF-8" />
======================================== Message Resources Definitions
<message-resources
parameter="com.xilinx.web.registration.struts.res.ApplicationResources" />
=============================================== Plug Ins Configuration -->
<!--======================================================= Tiles plugin -->
<!--
This plugin initialize Tiles definition factory. This later can takes some
parameters explained here after. The plugin first read parameters from
web.xml, thenoverload them with parameters defined here. All parameters
are optional.
The plugin should be declared in each struts-config file.
- definitions-config: (optional)
Specify configuration file names. There can be several comma
separated file names (default: ?? )
- moduleAware: (optional - struts1.1)
Specify if the Tiles definition factory is module aware. If true
(default), there will be one factory for each Struts module.
If false, there will be one common factory for all module. In this
later case, it is still needed to declare one plugin per module.
The factory will be initialized with parameters found in the first
initialized plugin (generally the one associated with the default
module).
true : One factory per module. (default)
false : one single shared factory for all modules
- definitions-parser-validate: (optional)
Specify if xml parser should validate the Tiles configuration file.
true : validate. DTD should be specified in file header (default)
false : no validation
Paths found in Tiles definitions are relative to the main context.
-->
<plug-in className="org.apache.struts.tiles.TilesPlugin" >
<set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" />
<set-property property="definitions-debug" value="2" />
<set-property property="definitions-parser-details" value="2" />
<set-property property="definitions-parser-validate" value="true" />
</plug-in>
<!-- =================================================== Validator plugin
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames"
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml" />
</plug-in>
-->
</struts-config>
tiles-defs.xml (in the WEB-INF directory as are the other xml files...):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
<tiles-definitions>
<definition name="Tiles.register" page="/tiles/template.jsp">
<put name="header" value="/tiles/header.jsp" />
<put name="body" value="/register.jsp" />
<put name="footer" value="/tiles/footer.jsp" />
</definition>
</tiles-definitions>
Console output when starting the server:
INFO: Starting Servlet Engine: Apache Tomcat/5.5.17
Jul 7, 2006 11:36:41 AM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Jul 7, 2006 11:36:43 AM org.apache.struts.tiles.xmlDefinition.I18nFactorySet initFactory
SEVERE: null : Can't find file '/WEB-INF/tiles-defs.xml'
Jul 7, 2006 11:36:43 AM org.apache.struts.tiles.TilesPlugin initDefinitionsFactory
SEVERE: Can't create Tiles definition factory for module ''.
Jul 7, 2006 11:36:43 AM org.apache.struts.action.ActionServlet init
SEVERE: Unable to initialize Struts ActionServlet due to an unexpected exception or error thrown, so marking the servlet as unavailable. Most likely, this is due to an incorrect or missing library dependency.
javax.servlet.ServletException: null : Can't find file '/WEB-INF/tiles-defs.xml'
at org.apache.struts.tiles.TilesPlugin.initDefinitionsFactory(TilesPlugin.java:233)
at org.apache.struts.tiles.TilesPlugin.init(TilesPlugin.java:137)
at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:869)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3917)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4201)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
at org.apache.catalina.core.StandardService.start(StandardService.java:450)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
Jul 7, 2006 11:36:43 AM org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet action as unavailable
Jul 7, 2006 11:36:43 AM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet /admin threw load() exception
javax.servlet.UnavailableException: null : Can't find file '/WEB-INF/tiles-defs.xml'
I have the following jars in my Web App Libraries (WEB-INF/lib):
standard.jar
commons-fileupload.jar
antlr.jar
struts.jar
commons-beanutils.jar
commons-logging.jar
commons-validator.jar
myswl-connector-java-3.1.12-bin.jar
struts-el.jar
jstl.jar
commons-digester.jar
Struts is version: 1.2.9.
JRE / JDK: 1.5.0_06 (Program files shows I have JRE 1.5.0_05 in the tree as well)
Note: Struts will work if I comment out the tiles plug-in in the struts-config.xml file.you don�t call o files-defs.xml in jsp?
-
Tiles / JSF with single tiles-defs.xml file, no templating JSPs?
All the examples I've seen for using JSF with Tiles use many JSP files for the templating information, resulting in twice as many JSP files as you would have in, say, a typical Struts project.
When coding in Struts you can forward to a tiles definition, meaning that if all your page layouts are defined in tiles-defs.xml, then you only need to provide the JSPs for the non-standard parts of each page.
With JSF it seems that you need to provide a JSP for the template for each file (which might end up being a single <tiles:insert... />, and the JSP for the non-standard bits for that page.
Is there a way to either a) combine those two JSP files into one (by maby using a <tiles:put ... type="string"/> - tried this, couldn't get it to work), or b) get something similar to the way Struts + Tiles works?It does not work by default. It is a fact.
Source for Struts, Tiles and even JSF are open now. I.e. everybody who has interest can research this question.
I got this reply from another forum for this question and I am currently working on it. Lets see if we get somewhere. -
Problem with multiple tiles-defs.xmls in struts
Hi,
I am using struts1.3.I have two struts-config.xml files in my application.I am adding those files in web.xml.
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>
org.apache.struts.action.ActionServlet
</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/first-struts-config.xml,/WEB-INF/settings-struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>convertNull</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>chainConfig</param-name>
<param-value>
org/apache/struts/tiles/chain-config.xml
</param-value>
</init-param>
</servlet>Each struts-config.xml file have seperate tiles-defs.xml .I am adding those files like the following
first-struts-config.xml
<plug-in className="org.apache.struts.tiles.TilesPlugin">
<set-property property="definitions-config" value="/WEB-INF/first-tiles-defs.xml" />
<!-- Set Module-awareness to true -->
<set-property property="moduleAware" value="true" />
</plug-in>settings-struts-config.xml
<plug-in className="org.apache.struts.tiles.TilesPlugin">
<set-property property="definitions-config" value="/WEB-INF/settingst-tiles-defs.xml" />
<!-- Set Module-awareness to true -->
<set-property property="moduleAware" value="true" />
</plug-in>I am getting one error
javax.servlet.ServletException: Path .settings.users does not start with a "/" character..settings.users definition is specified in settingst-tiles-defs.xml.
If i want to pick the definitions which are there in first-tiles-defs.xml ,then it is working fine.
Is there any idea for this problem?
Regards
kondalTry a forum/mailinglist devoted to struts. There´s one at their own homepage over there at apache.org.
-
URGENT help needed in creating external xml video plalist. Please help!
I was given an assignment to create and external video playlist using an xml file. I have never used flash before, know nothing about encoding and all that was given to the class in terms of instuctions was a short tutorial that has no resources for troubleshooting. We were given everything; the external playlist file equipped with the video skin, the video list, actionscript that loads the xml and the xml file. We were told that all we need to do is change the names of the videos in the xml file to match the names of our videos. I did that. We were also told we needed to "name target", but we were not informed on how to do this. I have tried everything, visited every tutorial and I cannot figure out how to get this damn thing to work. I cannot even get flash to load the xml file. PLEASE HELP.
Here is the xml file:
<?xml version = "1.0" encoding = "i-8859-1"?>
<playlist>
<ADogWithoutABone
flvurl="ADogWithoutABone.flv"
desc="Hyper Wall First Video" />
<Highway
flvurl="Highway.flv"
desc="Hyper Wall Second Video" />
<PsychoBabble
flvurl="PsychoBabble.flv"
desc="Hyper Wall Third Video" />
<SomethingElse
flvurl="SomethingElse.flv"
desc="Hyper Wall Fourth Video" />
</playlist>
I tried putting in the entire address of the file location, but it did nothing.
Here is the actionscript in the flash file:
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
xmlLoader.load(new URLRequest("playlistXML.xml"));
function xmlLoaded(event:Event):void {
var playlistXML:XML = new XML(event.target.data);
var item:XML;
for each(item in playlistXML.videoname) {
trace("item: "+item.attribute("flvurl").toXMLString());
myPlayList.addItem({label:item.attribute("desc").toXMLString(), data:item.attribute("flvurl").toXMLString()});
//Select the first video
myPlayList.selectedIndex = 0;
//And automatically play it
myPlayScreen.play(myPlayList.selectedItem.data);
//Add a listener to detect when new video is selected and play it
function listListener(event:Event) {
myPlayScreen.play(event.target.selectedItem.data);
myPlayList.addEventListener(Event.CHANGE, listListener);
I tried placing the full address of the xml file in, along with the file address of the videos, but again it did nothing. Everything is located in the same file, and the videos in a sub file in that file. I tried taking out the sub file and putting all the videos in the same file, but it did nothing. I am sure it's something very simple, but like I said I have NO experience with this whatsoever. I am SO lost and DESPERATELY need help. PLEASE someone SAVE MEEEE!
ThanksIt might be a crossdomain.xml problem.
Please make sure that the server hosting the xml allows the domain where the swf is hosted.
You can start with:
<?xml version="1.0" encoding="utf-8" ?>
<cross-domain-policy>
<allow-access-from domain="*"/>
<site-control permitted-cross-domain-policies="master-only"/>
</cross-domain-policy> -
Help needed for db to xml conversion & vice versa. & other tools
HI GURRUS!
I would like to need a solution for my university assignment ,
I want to create a web service which provides necessary interfaces to create, read (query), update, and delete data from relational db.
It fully utilizes the XML from the database all the way to the web service clients and create web pages that consume the same XML for data entry. i want to acomplish this assignment in J2EE using WebLogic.
I found lot of tools & api's on internet, but need help to suggest that wchih is best for this task & also need some good help to accomplish it more n more easily.
tools & apis are:
1) DB2XML ---> only cretae xml from db & also use "table based mapping"
2)XML-DBMS
3)Hit software's ---> Allora (don't know much about it)
4) Java api WebRowSet
questions:1) which are the best tools and software packages to be used to faciliate creation and maitenance of the XML schema and keeping it in sync with the database?
2)any good tools to create the database schema directly from the XML. Are there tools out there to generate a database access layer based on the XML?
3) Is any one have good java Webrowset example to accomplish that taks(get data from relational db send it to clint as xml using webservice & if client make changes in xml than it sync back the info in relational db)?
Thanks in advanceOops sorry i just want to create a method which saves the created dom document as an xml file.
Thanks in advance ! -
Very urgent help needed- Error while passing XML document to Oracle stored
Hi !
I have been struggling a lot to call Oracle 9i stored procedure passing Stringbuilder object type from ASP.NET
I am using Visual Studio 2008 Professional, OS: Windows XP and Oracle: 9.2.0.1.0
Following is the procedure:
CREATE or REPLACE PROCEDURE loadCompanyInfo (clobxml IN clob) IS
-- Declare a CLOB variable
ciXML clob;
BEGIN
-- Store the Purchase Order XML in the CLOB variable
ciXML := clobxml;
-- Insert the Purchase Order XML into an XMLType column
INSERT INTO companyinfotbl (companyinfo) VALUES (XMLTYPE(ciXML));
commit;
--Handle the exceptions
EXCEPTION
WHEN OTHERS THEN
raise_application_error(-20101, 'Exception occurred in loadCompanyInfo procedure :'||SQLERRM);
END loadCompanyInfo ;
And following is the ASP.net code:
StringBuilder b = new StringBuilder();
b.Append("<?xml version=\"1.0\" encoding=\"utf-8\" ?>");
b.Append("<item>");
b.Append("<price>500</price>");
b.Append("<description>some item</description>");
b.Append("<quantity>5</quantity>");
b.Append("</item>");
//Here you'll have the Xml as a string
string myXmlString1 = b.ToString();
//string result;
using (OracleConnection objConn = new OracleConnection("Data Source=testdb; User ID=testuser; Password=pwd1"))
OracleCommand objCmd = new OracleCommand();
objCmd.Connection = objConn;
objCmd.CommandText = "loadCompanyInfo";
objCmd.CommandType = CommandType.StoredProcedure;
//OracleParameter pmyXmlString1 = new OracleParameter("pmyXmlString1", new OracleString(myXmlString1));
objCmd.Parameters.Add("myXmlString1", OracleType.clob);
objCmd.Parameters.Add(myXmlString1).Direction = ParameterDirection.Input;
//objCmd.Parameters.Add("result", OracleType.VarChar).Direction = ParameterDirection.Output;
try
objConn.Open();
objCmd.ExecuteNonQuery();
catch (Exception ex)
Label1.Text = "Exception: {0}" + ex.ToString();
objConn.Close();
When I am trying to execute it, I am getting the following error:
Exception: {0}System.Data.OracleClient.OracleException: ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'LOADCOMPANYINFO' ORA-06550: line 1, column 7: PL/SQL: Statement ignored at System.Data.OracleClient.OracleConnection.CheckError(OciErrorHandle errorHandle, Int32 rc) at System.Data.OracleClient.OracleCommand.Execute(OciStatementHandle statementHandle, CommandBehavior behavior, Boolean needRowid, OciRowidDescriptor& rowidDescriptor, ArrayList& resultParameterOrdinals) at System.Data.OracleClient.OracleCommand.ExecuteNonQueryInternal(Boolean needRowid, OciRowidDescriptor& rowidDescriptor) at System.Data.OracleClient.OracleCommand.ExecuteNonQuery() at Default.Button1Click(Object sender, EventArgs e)
I understand from this that the .net type is not the correct one, but I am not sure how to correct it. I could not find any proper example in any documentation that I came across. Most of the examples give information on how to read but not how to insert XML into Oracle table by calling Stored Procedure.
Can you please help me to solve this problem? I hope that you can help solve this.
Also, can you please give me an example of passing XML document XMLdocument to Oracle Stored procedure.
In both the cases, if you can provide the working code then it would be of great help.
Thanks,Hi ,
Additional to the Above error details my BPEL code looks like this:
<process name="BPELProcess1"
targetNamespace="http://xmlns.oracle.com/Application10/Project10/BPELProcess1"
xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
xmlns:client="http://xmlns.oracle.com/Application10/Project10/BPELProcess1"
xmlns:ora="http://schemas.oracle.com/xpath/extension"
xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
<partnerLinks>
<partnerLink name="bpelprocess1_client" partnerLinkType="client:BPELProcess1" myRole="BPELProcess1Provider" partnerRole="BPELProcess1Requester"/>
</partnerLinks>
<variables>
<variable name="inputVariable" messageType="client:BPELProcess1RequestMessage"/>
<variable name="outputVariable" messageType="client:BPELProcess1ResponseMessage"/>
</variables>
<sequence name="main">
<receive name="receiveInput" partnerLink="bpelprocess1_client" portType="client:BPELProcess1" operation="process" variable="inputVariable" createInstance="yes"/>
<invoke name="callbackClient" partnerLink="bpelprocess1_client" portType="client:BPELProcess1Callback" operation="processResponse" inputVariable="outputVariable"/>
</sequence>
</process>
Kindly help if anyone has faced this Issue before.
Regards,
Rakshitha -
Help needed to load different xml playlists by clicking button
Hi there,
I have a series of buttons, when i double click a button i want to load a new xml file
I have some functioning code, but when i click on more than one button per run of the application, it will only use the first xml that was clicked / loaded.
Does anyone have any suggestions I would be really grateful
Thanks!
// Music player populated via XML formatted data with associated .mp3 audio files
// songs to play structured as an XMLList class
// displays artist and song title in the interface
cover.visible = false;
cover2.visible = false;
// song list base on an XMLList class
var songList:XMLList;
// total number of songs in list
var songsTotal:Number;
// sound class variable
var sound:Sound;
// sound channnel variable to play, pause and stop the sound
var soundChannel:SoundChannel;
// holds a reference to the current song playing
var currentSong:Number = 0;
// variable to store the song position when paused
var songPosition:Number;
// flag to check if current song is paused
var songPaused:Boolean;
// loader for XML via a URL
var XMLLoader:URLLoader = new URLLoader();
// various buttons to control songs via the interface
next_btn.addEventListener(MouseEvent.CLICK, onNext);
prev_btn.addEventListener(MouseEvent.CLICK, onPrev);
pause_btn.addEventListener(MouseEvent.CLICK, onPause);
play_btn.addEventListener(MouseEvent.CLICK, onPlay);
album1.doubleClickEnabled=true;
album2.doubleClickEnabled=true;
album1.addEventListener(MouseEvent.DOUBLE_CLICK, loadalbum1);
album2.addEventListener(MouseEvent.DOUBLE_CLICK, loadalbum2);
// check the data has loaded correctly
XMLLoader.addEventListener(Event.COMPLETE, processXML);
// this function processes the XML data
function processXML(e:Event):void {
// create an XML playlist structure
var anXMLplayList:XML = new XML(e.target.data);
// associate the playlist songs with the internal song list
songList = anXMLplayList.SONG;
// set the total songs to those found in the XML data
songsTotal = songList.length();
// remove the eventlistener and restore variables
XMLLoader.removeEventListener(Event.COMPLETE, processXML);
XMLLoader = null;
// this function starts the first song in the list
// when the play_btn is pressed via the onPlay function
function playSong(aSong:Number):void {
// variables for the Title, Artist and associated song in the song list
var aTitle = songList[aSong].@TITLE;
var anArtist = songList[aSong].@ARTIST;
var aURL = songList[aSong].@URL;
// populate the interface with the current song data
title_txt.text = aTitle;
artist_txt.text = anArtist;
// check to see if the sound channel is active
if (soundChannel) {
soundChannel.stop();
soundChannel.removeEventListener(Event.SOUND_COMPLETE, onNext);
// create a new sound object
sound = new Sound();
// load the sound from the URL song data
sound.load(new URLRequest(aURL));
// activate the sound channel via the play method
soundChannel = sound.play();
// when the current songh completes - play the next song via the onNext function
soundChannel.addEventListener(Event.SOUND_COMPLETE, onNext);
// this function plays the next song in the list
function onNext(e:Event):void {
// increment the current song
currentSong++;
// reset the current song if no more to play
if (currentSong>=songsTotal) {
currentSong=0;
// else play the current song via the playSong method
playSong(currentSong);
// this function plays the previous song in the song list
function onPrev(e:MouseEvent):void {
currentSong--;
if (currentSong<0) {
currentSong = songsTotal-1;
playSong(currentSong);
// this function pauses the current song playing and sets the boolean flag
// accordingly
function onPause(e:MouseEvent):void {
if (soundChannel) {
songPosition = soundChannel.position;
soundChannel.stop();
songPaused=true;
// this function plays the current song or restarts a paused song
function onPlay(e:MouseEvent):void {
if (songPaused) {
soundChannel = sound.play(songPosition);
songPaused=false;
} else if (!soundChannel) {
playSong(currentSong);
function loadalbum1(e:Event):void {
cover.visible = true;
cover2.visible = false;
// load the XML formated playlist
XMLLoader.load(new URLRequest("playlist1.xml"));
function loadalbum2(e:Event):void {
cover2.visible = true;
cover.visible = false;
// load the XML formated playlist
XMLLoader.load(new URLRequest("playlist2.xml"));You should try to limit the code you post to what is relevant to the problem... it is hard to track things down, especially when your code is not formatted properly with indentations.
I didn't search farther than finding that you remove the event listener for the URLLoader...
XMLLoader.removeEventListener(Event.COMPLETE, processXML);
so if you remove it after you load the first file and do not restore one for it, then chances are you don't "processXML" any more than the first file you load -
Need a help with Struts Tiles dynamic menu
Hello,
I am started few days ago with Tiles, try to develop web application.
Can anybody sugest very simple example with Tiles and menu.
So my definition looks like this:
tiles-def.xml
<tiles-definitions>
<definition name="MainDefinition" path="/layouts/myLayout.jsp">
<put name="title" value="This is the title." />
<put name="header" value="/tiles/header.jsp" />
<put name="menu" value="/tiles/menu.jsp" />
<put name="body" value="/tiles/body.jsp" />
<put name="footer" value="This is the footer." />
</definition>
I am simple layout.
I need to on menu click change body content, now i am doing it like this:
index.jsp
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%String body = request.getParameter("body");%>
<tiles:insert definition="MainDefinition" flush="true">
<tiles:put name="body" type="string"> <%= body %> </tiles:put>
</tiles:insert>
But now body is a string how to make it open url?
Maybe somebody have link to menu Tiles good examples.
ThanksBut here's some useful advice :P
I'm going to assume that the other two people involved in this have a bit more experience, have them do most of the designing. Have them leave most of the easy stuff for you. You can then spend your time learning the minimum of what you need to know. And if you have problems, or don't understand things, ask your partners for help.
And you'll want to set some spare time for you to all get together and do something fun so that you don't kill each other because of the stress :P
I've had a lot of bad project experiences, fortunatly they where all just at school :P I blame myself, mainly because I didn't do the whole thing myself (mostly because I listened to people when they said that I shouldn't or couldn't do everything myself.) I'd like to say that it's mostly because of poor communication, and disorganization, but an awful lot of it had to do with the fact that I tend to be the only person with any work ethic what so ever.
But whinning and repressed memories aside, good communication and organization help a lot. Come up with a good system with your team mates. And don't be afraid to ask questions. And don't worry about dividing up the work load equally. Just make sure you put in a good amount of effort, if not frightening amounts.
If all of you are clueless, divide up the learning stuff between yourselves too.
I have no experience with Struts. I've done a bit of stuff with XML, but nothing too complicated. The XML by itself tends to be extremely easy. What you plan on doing with it can vary (I don't like XML incidentally :P)
Other then that, good luck. -
Hello guys
SELECT XMLELEMENT
"order",
XMLELEMENT("load",
XMLATTRIBUTES(T.ID AS "foio",
'AL' AS "acio",
DECODE(i.type,'b',5001,'NA',5002) "pinio"
FROM inventory i,
ORDERS O
WHERE i.ID=O.TICKET;
I am getting out put as
<order>
<load foio=1 acio="AL" pinio="5001" >
</order>
But i need
<?xml version = "1.0"?>
<order>
<load foio=1 acio="AL" pinio="5001" >
</order>
like this
How can i include <?xml version = "1.0"?> above the xml message?
Help needed
SmHai i used
SELECT SYS.XMLTYPE.createxml('<?xml version = "1.0"?>'||''||
XMLELEMENT
"order", XMLELEMENT("load",
XMLATTRIBUTES(T.ID AS "foio",
'AL' AS "acio",
DECODE(i.type,'b',5001,'NA',5002) "pinio"
FROM inventory i,
ORDERS O
WHERE i.ID=O.TICKET;
it is working fine
pls give more suggestions
S -
I need to export an XML but the option is not there for me to do so! Help..
I need to export an xml from final cut pro x. The 'File - Export XML' option isnt there?? I have Final Cut Pro X Version 10.0.. Can anyone help?
File->Export XML...
Make sure that you have the timeline selected, or the project selected in the Project Library. -
Help: Need to finding Best way of Processing XML feeds into MySQL
Hi,
I wrote a bit of java code a couple of years ago to take an xml feed and load into MySQL.
It's ok for small files but memory intensive as the file gets larger.
1) Loads the XML into memory
2) Process nodes sequentially usiung via Cached XML Parser (xalan) ... memory
3) Writes each record ... slow
It needs updating and the xml files are bigger.
Any clues on how to do this efficiently?
Cheers,
Markmarkied wrote:
Load into in MySQL could take two steps:
1) bulk load into flat/generic xml structure in MySQL, if poss?
2) cache reading from flat/generic xml structure from MySQL and rewriting to new schema.I don't understand what either of those things mean so it's pretty hard to suggest alternatives to them.
If you're running out of memory then I assume you must be using DOM. I would have thought that sequential parsers like SAX and StAX would work for loading an XML document into an SQL database, no matter what database structures were involved. -
Help needed : Extension manager cs6 not listing products
Help needed to Adobe extension manager cs6 to show all my cs6 products
I downloaded Extension manager from here Adobe - Exchange : Download the Adobe Extension Manager
My Computer windows xp 32bit
My Photosop version cs6
My Dreamweaver version cs6
I installed photoshop here : C:\Program Files\Adobe\Adobe Dreamweaver CS6
and my XManConfigfile
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<VariableForExMan>
<Data key="$sharedextensionfolder">$shareddatafolder/Adobe/Dreamweaver CS6/$LOCALE/Configuration/Extensions</Data>
<Data key="$dreamweaver">$installfolder</Data>
<Data key="$dreamweaver/Configuration">$userdatafolder/Adobe/Dreamweaver CS6/$LOCALE/Configuration</Data>
<Data key="$UserBinfolder">$userdatafolder/Adobe/Dreamweaver CS6/$LOCALE</Data>
<Data key="NeedOperationNotification">true</Data>
<Data key="QuitScript">dw.quitApplication()</Data>
<Data key="SupportedInSuite">CS6</Data>
<Data key="HostNameForCSXS">DRWV</Data>
<Data key="ProductVersion">12.0</Data>
<Data key="Bit">32</Data>
<Data key="DefaultLocale">en_US</Data>
</VariableForExMan>
</Configuration>
Extension manager installed here : C:\Program Files\Adobe\Adobe Extension Manager CS6
Photoshop Installed here: C:\Program Files\Adobe\Adobe Photoshop CS6
and my XManConfigfile
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<VariableForExMan>
<Data key="EmStorePath">$SharedRibsDataFolder/Adobe/Extension Manager</Data>
<Data key="$photoshopappfolder">$installfolder</Data>
<Data key="$pluginsfolder">$photoshopappfolder/Plug-Ins</Data>
<Data key="$presetsfolder">$photoshopappfolder/Presets</Data>
<Data key="$platform">Win</Data>
<Data key="$actions">$presetsfolder/Actions</Data>
<Data key="$blackandwhite">$presetsfolder/Black and White</Data>
<Data key="$brushes">$presetsfolder/Brushes</Data>
<Data key="$channelmixer">$presetsfolder/Channel Mixer</Data>
<Data key="$colorbooks">$presetsfolder/Color Books</Data>
<Data key="$colorrange">$presetsfolder/Color Range</Data>
<Data key="$colorswatches">$presetsfolder/Color Swatches</Data>
<Data key="$contours">$presetsfolder/Contours</Data>
<Data key="$curves">$presetsfolder/Curves</Data>
<Data key="$customshapes">$presetsfolder/Custom Shapes</Data>
<Data key="$duotones">$presetsfolder/Duotones</Data>
<Data key="$exposure">$presetsfolder/Exposure</Data>
<Data key="$gradients">$presetsfolder/Gradients</Data>
<Data key="$huesat">$presetsfolder/Hue Sat</Data>
<Data key="$imagestatistics">$presetsfolder/Image Statistics</Data>
<Data key="$keyboardshortcuts">$presetsfolder/Keyboard Shortcuts</Data>
<Data key="$layouts">$presetsfolder/Layouts</Data>
<Data key="$lenscorrection">$presetsfolder/Lens Correction</Data>
<Data key="$levels">$presetsfolder/Levels</Data>
<Data key="$liquifymeshes">$presetsfolder/Liquify Meshes</Data>
<Data key="$menucustomization">$presetsfolder/Menu Customization</Data>
<Data key="$optimizedcolors">$presetsfolder/Optimized Colors</Data>
<Data key="$optimizedoutputSettings">$presetsfolder/Optimized Output Settings</Data>
<Data key="$optimizedsettings">$presetsfolder/Optimized Settings</Data>
<Data key="$patterns">$presetsfolder/Patterns</Data>
<Data key="$reducenoise">$presetsfolder/Reduce Noise</Data>
<Data key="$replacecolor">$presetsfolder/Replace Color</Data>
<Data key="$scripts">$presetsfolder/Scripts</Data>
<Data key="$selectivecolor">$presetsfolder/Selective Color</Data>
<Data key="$shadowhighlight">$presetsfolder/Shadow Highlight</Data>
<Data key="$smartsharpen">$presetsfolder/Smart Sharpen</Data>
<Data key="$styles">$presetsfolder/Styles</Data>
<Data key="$textures">$presetsfolder/Textures</Data>
<Data key="$tools">$presetsfolder/Tools</Data>
<Data key="$variations">$presetsfolder/Variations</Data>
<Data key="$webphotogallery">$presetsfolder/Web Photo Gallery</Data>
<Data key="$workspaces">$presetsfolder/Workspaces</Data>
<Data key="$zoomify">$presetsfolder/Zoomify</Data>
<Data key="$hueandsaturation">$presetsfolder/Hue and Saturation</Data>
<Data key="$lights">$presetsfolder/Lights</Data>
<Data key="$materials">$presetsfolder/Materials</Data>
<Data key="$meshes">$presetsfolder/Meshes</Data>
<Data key="$rendersettings">$presetsfolder/Render Settings</Data>
<Data key="$volumes">$presetsfolder/Volumes</Data>
<Data key="$widgets">$presetsfolder/Widgets</Data>
<Data key="$localesfolder">$photoshopappfolder/Locales</Data>
<Data key="$additionalplugins">$localesfolder/$LOCALE/Additional Plug-ins</Data>
<Data key="$additionalpresets">$localesfolder/$LOCALE/Additional Presets</Data>
<Data key="$localeskeyboardshortcuts">$localesfolder/$LOCALE/Additional Presets/$platform/Keyboard Shortcuts</Data>
<Data key="$localesmenucustomization">$localesfolder/$LOCALE/Additional Presets/$platform/Menu Customization</Data>
<Data key="$localesworkspaces">$localesfolder/$LOCALE/Additional Presets/$platform/Workspaces</Data>
<Data key="$automate">$pluginsfolder/Automate</Data>
<Data key="$digimarc">$pluginsfolder/Digimarc</Data>
<Data key="$displacementmaps">$pluginsfolder/Displacement Maps</Data>
<Data key="$effects">$pluginsfolder/Effects</Data>
<Data key="$extensions">$pluginsfolder/Extensions</Data>
<Data key="$fileformats">$pluginsfolder/File Formats</Data>
<Data key="$filters">$pluginsfolder/Filters</Data>
<Data key="$imagestacks">$pluginsfolder/Image Stacks</Data>
<Data key="$importexport">$pluginsfolder/Import-Export</Data>
<Data key="$measurements">$pluginsfolder/Measurements</Data>
<Data key="$panels">$pluginsfolder/Panels</Data>
<Data key="$parser">$pluginsfolder/Parser</Data>
<Data key="$3dengines">$pluginsfolder/3D Engines</Data>
<Data key="$lightingstyles">$pluginsfolder/Filters/Lighting Styles</Data>
<Data key="$matlab">$photoshopappfolder/MATLAB</Data>
<Data key="UserExtensionFolder">$photoshopappfolder</Data>
<Data key="$photoshop">$UserDataFolder/Adobe/Adobe Photoshop CS6/Configuration</Data>
<Data key="DisplayName">Photoshop CS6 32</Data>
<Data key="ProductName">Photoshop32</Data>
<Data key="FamilyName">Photoshop</Data>
<Data key="ProductVersion">13.0</Data>
<Data key="IconPath">Configuration/PS_exman_24px.png</Data>
<Data key="SupportedInSuite">CS6</Data>
<Data key="HostNameForCSXS">PHSP</Data>
<Data key="Bit">32</Data>
</VariableForExMan>
</Configuration>
Please someone help me i cant install any photoshop extension because of this issue,,,Waiting for your reply ...thanks
Here is the results
I installed photoshopcs6 illustrator cs6 dreamweaver cs6 illustrator cs6 in the system , But nothing seems
Result: BridgeTalk Diagnostics
Info:
Name = estoolkit-3.8
Status = PUMPING
Path
Version = 2.0
Build = ES 4.2.12
Next serial number = 40
Logging: = OFF
Now = 15:55:49
Messages:
Message Version = 2.05
Authentication = ON
Digest = ON
Thread: estoolkit-3.8#thread
Avg. pump interval = 55ms
Last pump = 62ms ago
Ping: 7
ECHO_REQUEST: ECHO_RESPONSE
Timeout = undefined
Handler = undefined
STATUS: PUMPING
Timeout = undefined
Handler = undefined
MAIN: MAIN
Timeout = undefined
Handler = installed
LAUNCHED: LAUNCHED
Timeout = undefined
Handler = installed
DIAGNOSTICS: DIAGNOSTICS
Timeout = undefined
Handler = installed
INFO: INFO
Timeout = undefined
Handler = installed
SETUPTIME: thread=0ms, left=16ms
Timeout = undefined
Handler = undefined
Instances: 3
estoolkit-3.8#dbg:
msg[15:55:49]: 00000035
@BT>Version = 2.05
Target = estoolkit-3.8#dbg
Sender = estoolkit-3.8#dbg
Sender-ID = localhost:win3788
Timeout = 15:55:50
Type = Ignore
Response-Request = Timeout
Headers = (no headers)
Timestamp = 15:55:49
Serial-Number = 35
Received = undefined
Result = undefined
Error = undefined
Body = (empty)
Incoming: 1
Outgoing: 0
Handler: 9
ExtendScript = for all messages
Error = for only msg #25
Error = for only msg #27
Error = for only msg #31
Result = for only msg #35
Error = for only msg #35
Timeout = for only msg #35
Result = for only msg #37
Error = for only msg #37
estoolkit-3.8#estk:
msg[15:55:49]: 00000037
@BT>Version = 2.05
Target = estoolkit-3.8#estk
Sender = estoolkit-3.8#dbg
Sender-ID = localhost:win3788
Timeout = 16:05:49
Type = Debug
Response-Request = Result Error
Headers = (no headers)
Timestamp = 15:55:49
Serial-Number = 37
Received = undefined
Result = undefined
Error = undefined
Body: 107 bytes
Text = <get-properties engine="main" object="$.global" exclude="undefined,builtin,prototype" all="true" max="20"/>
Incoming: 1
Outgoing: 0
Handler: 1
ExtendScript = for all messages
estoolkit-3.8: (main)
Incoming: 0
Outgoing: 0
Handler: 1
ExtendScript = for all messages
Targets: 1
Connector = PCD
Installed: 0
Running: 0
exman-6.0:
Path = C:\Program Files\Adobe\Adobe Extension Manager CS6\Adobe Extension Manager CS6.exe
Display Name = Adobe Extension Manager CS6
MsgAuthentication = ON
MsgDigest = ON
ESTK = OFF
BundleID = com.adobe.exman
Status = (not running)
ExeName = Adobe Extension Manager CS6.exe
Installed: 1
Running: 0
Groups = (no groups defined) -
Help needed while exporting crystal reports to HTML file format using java
Help needed while exporting crystal reports to HTML file format using java api(not using crystalviewer).i want to download the
html file of the report
thanksthe ReportExportFormat class does not have HTML format, it has got to be XML. Export to HTML is available from CR Designer only.
Edited by: Aasavari Bhave on Jan 24, 2012 11:37 AM -
Help needed to loadjava apache poi jars into oracle database.
Help needed to loadjava apache poi jars into oracle database. Many classes left unresolved. (Poi 3.7, database 11.1.0.7). Please share your experience!
Hi,
The first 3 steps are just perfect.
But with
loadjava.bat -user=user/pw@connstr -force -resolve geronimo-stax-api_1.0_spec-1.0.jar
the results are rather unexpected. Here is a part of the log file:
arguments: '-user' 'ccc/***@bisera7-db.dev.srv' '-fileout' 'c:\temp\load4.log' '-force' '-resolve' '-jarsasdbobjects' '-v' 'geronimo-stax-api_1.0_spec-1.0.jar'
The following operations failed
resource META-INF/MANIFEST.MF: creation (createFailed)
class javax/xml/stream/EventFilter: resolution
class javax/xml/stream/events/Attribute: resolution
class javax/xml/stream/events/Characters: resolution
class javax/xml/stream/events/Comment: resolution
class javax/xml/stream/events/DTD: resolution
class javax/xml/stream/events/EndDocument: resolution
class javax/xml/stream/events/EndElement: resolution
class javax/xml/stream/events/EntityDeclaration: resolution
class javax/xml/stream/events/EntityReference: resolution
class javax/xml/stream/events/Namespace: resolution
class javax/xml/stream/events/NotationDeclaration: resolution
class javax/xml/stream/events/ProcessingInstruction: resolution
class javax/xml/stream/events/StartDocument: resolution
class javax/xml/stream/events/StartElement: resolution
class javax/xml/stream/events/XMLEvent: resolution
class javax/xml/stream/StreamFilter: resolution
class javax/xml/stream/util/EventReaderDelegate: resolution
class javax/xml/stream/util/StreamReaderDelegate: resolution
class javax/xml/stream/util/XMLEventAllocator: resolution
class javax/xml/stream/util/XMLEventConsumer: resolution
class javax/xml/stream/XMLEventFactory: resolution
class javax/xml/stream/XMLEventReader: resolution
class javax/xml/stream/XMLEventWriter: resolution
class javax/xml/stream/XMLInputFactory: resolution
class javax/xml/stream/XMLOutputFactory: resolution
class javax/xml/stream/XMLStreamReader: resolution
resource META-INF/LICENSE.txt: creation (createFailed)
resource META-INF/NOTICE.txt: creation (createFailed)
It seems to me that the root of the problem is the error:
ORA-29521: referenced name javax/xml/namespace/QName could not be found
This class exists in the SYS schema though and is valid. If SYS should be included as a resolver? How to solve this problem?
Maybe you are looking for
-
Context,Physical schema and Logical schema
Hi, How the context,physical schema,logical schema and agent are interrelated. Please explain Thanks Jack
-
Trying to upgrade to iPhoto 9.6. Seems to just hang. In the app store it says "installing". Any ideas?
-
Zen Sleek Photo -vs- Zen Visio
I am looking into getting one of these two mp3 players and cant seem to decide which. What are the pros and cons of each? I want... *somthing with a decent amount of memory but not so much that i wouldnt use it all. *Somthing small in size that wont
-
Exporting sap web reporting to ppt fprmat
Hi, We are using SAP BW 3.5 in our company. I would like to know if it is possible to export the Web Reporting to PPT format. I am expecting your answers and it would be helpful if i get your valuable suggestion/answer. Thanks. Raj Mohan
-
Horizontal layout for radio options
Hi Forum, we currently extend a components dialog with some options to let the authors choose from some predefined styles. So far this works pretty good. Each fieldset contains one widget that is rendered as xtype=selection,type=radio. Now we want th