Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Help me... Pls

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi,
I am new to Struts2_ajax tags. And I am using Ajax tags in my page just to check the ajax supported tags in Struts2. Following is my code:

The testajax.jsp => home page
---------------------------------
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>Ajax Examples</title>
<!--// START SNIPPET: common-include-->
<jsp:include page="/ajax/commonInclude.jsp"/>
<!--// END SNIPPET: common-include-->
</head>

<body>
<div id="div1">Div 1</div>
<div id="div2">Div 2</div>
<s:url id="ajaxTest" value="/showAjaxResponse.action" />
<s:a theme="ajax" href="%{ajaxTest}" targets="dev1,dev2">Update divs</s:a>
</body>
</html>

Struts.xml
----------
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>

<package name="ajaxexample" extends="struts-default">
<action name="showAjaxResponse">
<result>/1.jsp</result>
</action>
</package>

</struts>

1.jsp
------
<%= "Hello.. This is ajax jsp response" %>


When i click on the link "Update divs", i am getting response in the next page, not getting in the same page div tags.
And one more thing: commonInclude.jsp i don't have and also ajax folder.
I found code like this:
<jsp:include page="/ajax/commonInclude.jsp"/>
Where will be this file, will this come with struts2 libraries??

Any other configurations required?
Can anyone please suggest me in running this Struts2_ajax jsp?

~ Thanks in advance..!
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please don't post the same question more than once. It causes confusion and duplication of effort as the community tries to help everyone.
Also, expecting a response in 20 minutes is a little unreasonable. Patience Is A Virtue
 
The moustache of a titan! The ad of a flea:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
    Bookmark Topic Watch Topic
  • New Topic