You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Jan K <ja...@symbiountech.com> on 2008/09/25 09:00:28 UTC

Include XML file

I need to include ant (build.xml) file in JSP.Can anyone help me to do this?
-- 
View this message in context: http://www.nabble.com/Include-XML-file-tp19664082p19664082.html
Sent from the Ant - Users mailing list archive at Nabble.com.

Re: Include XML file

Posted by Ognjen Blagojevic <og...@etf.bg.ac.yu>.
> I need to include ant (build.xml) file in JSP.Can anyone help me to do this?

What do you mean by including build.xml file in JSP? Do you need to 
display the escaped content of the XML file so the user can see it as 
part of the generated HTML?

-Ognjen

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Include XML file

Posted by Ognjen Blagojevic <og...@etf.bg.ac.yu>.
Nan Null wrote:
> I think you have a communication problem.

Yes, we did have, thanks for jumping in. :)


> Once you have the build.xml file, you can call (System.execute) Ant,
> passing in the path of the build file and the jsp.

Or it can be called directly from Java, using class 
org.apache.tools.ant.launch.Launcher, avoiding the call to the OS:

         String[] antArgs = {"targetName"};
         Launcher.main(antArgs);

Don't forget to put ant.jar and ant-launcher.jar in the classpath.

HTH,
-Ognjen


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Include XML file

Posted by Nan Null <nu...@gmail.com>.
I think you have a communication problem.

Here's how I understand your problem: you have a web application, with
a webpage (written in JSP) that you can submit a .java source file.
When a user submit the .java source file, you need to process the file
using Ant.

If that is the case, then you need a few things.  First, either the
user needs to submit the build.xml file, or you can create the file.
You can do that, by hand, or programatically, depending on your need.
Once you have the build.xml file, you can call (System.execute) Ant,
passing in the path of the build file and the jsp.  The JSP file can
be passed in as an environment variable (-Djsp.file=<filename>).  Then
you can access it in the Ant using ${env.jsp.file} (you have to
declare env, <property environment="env"/>).


On Thu, Sep 25, 2008 at 5:12 AM, Jan K <ja...@symbiountech.com> wrote:
>
> I am designing a web application For running Automated test.I record the flow
> of an application (say yahoo.com) using Selenium IDE and exporting the test
> suite to java.So now i have a file For example login.java.The application i
> am creating
> is like i will have a browse button.i will browse for file (say login.java)
> and click run button.On clicking run button ,i will pass the action through
> request parameter to jsp.
>
> Example:
> if ( run.equals(request.getParameter(action))) {
> // Call Build.xml
>
> }
> I need to call Ant Build.xml file.Because this site is more specific for
> uploading of selenium files only.Selenium server supports Ant to do this.So
> only i need to call Build.xml.Can you understand and help me to solve the
> problem.
>
>
>
>
> Ognjen Blagojevic wrote:
>>
>> Jan K wrote:
>>> I am developing a project for Testing Automated Test.I am using selenium
>>> server for running the test.So when i upload a test(say for example
>>> ,login.java)file and click Run button,through request parameter i get the
>>> action and need to invoke Ant build.xml file because selenium make use of
>>> Ant to run the test.So i need to know how to do this?
>>>
>>> Jan K wrote:
>>>> I need to include ant (build.xml) file in JSP.Can anyone help me to do
>>>> this?
>>
>> This is still very unclear...
>>
>> Could you explain this a little bit more? How do you use Selenium? Is it
>> Selenium IDE as browser plugin or something else?
>>
>> Where do you upload a test? To Selenium IDE?
>>
>> What is the action you get as request parameter?! Is it the name of the
>> target you need invoke in ant task?
>>
>> -Ognjen
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Include-XML-file-tp19664082p19665710.html
> Sent from the Ant - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Include XML file

Posted by Jan K <ja...@symbiountech.com>.
I am designing a web application For running Automated test.I record the flow
of an application (say yahoo.com) using Selenium IDE and exporting the test
suite to java.So now i have a file For example login.java.The application i
am creating 
is like i will have a browse button.i will browse for file (say login.java)
and click run button.On clicking run button ,i will pass the action through
request parameter to jsp.

Example:
if ( run.equals(request.getParameter(action))) {
// Call Build.xml

}
I need to call Ant Build.xml file.Because this site is more specific for
uploading of selenium files only.Selenium server supports Ant to do this.So
only i need to call Build.xml.Can you understand and help me to solve the
problem.




Ognjen Blagojevic wrote:
> 
> Jan K wrote:
>> I am developing a project for Testing Automated Test.I am using selenium
>> server for running the test.So when i upload a test(say for example
>> ,login.java)file and click Run button,through request parameter i get the
>> action and need to invoke Ant build.xml file because selenium make use of
>> Ant to run the test.So i need to know how to do this?
>> 
>> Jan K wrote:
>>> I need to include ant (build.xml) file in JSP.Can anyone help me to do
>>> this?
> 
> This is still very unclear...
> 
> Could you explain this a little bit more? How do you use Selenium? Is it 
> Selenium IDE as browser plugin or something else?
> 
> Where do you upload a test? To Selenium IDE?
> 
> What is the action you get as request parameter?! Is it the name of the 
> target you need invoke in ant task?
> 
> -Ognjen
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Include-XML-file-tp19664082p19665710.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Include XML file

Posted by Ognjen Blagojevic <og...@etf.bg.ac.yu>.
Jan K wrote:
> I am developing a project for Testing Automated Test.I am using selenium
> server for running the test.So when i upload a test(say for example
> ,login.java)file and click Run button,through request parameter i get the
> action and need to invoke Ant build.xml file because selenium make use of
> Ant to run the test.So i need to know how to do this?
> 
> Jan K wrote:
>> I need to include ant (build.xml) file in JSP.Can anyone help me to do
>> this?

This is still very unclear...

Could you explain this a little bit more? How do you use Selenium? Is it 
Selenium IDE as browser plugin or something else?

Where do you upload a test? To Selenium IDE?

What is the action you get as request parameter?! Is it the name of the 
target you need invoke in ant task?

-Ognjen


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Include XML file

Posted by Jan K <ja...@symbiountech.com>.
I am developing a project for Testing Automated Test.I am using selenium
server for running the test.So when i upload a test(say for example
,login.java)file and click Run button,through request parameter i get the
action and need to invoke Ant build.xml file because selenium make use of
Ant to run the test.So i need to know how to do this?


Jan K wrote:
> 
> I need to include ant (build.xml) file in JSP.Can anyone help me to do
> this?
> 

-- 
View this message in context: http://www.nabble.com/Include-XML-file-tp19664082p19664437.html
Sent from the Ant - Users mailing list archive at Nabble.com.