Same JSP different output display in different system - spring

Currently I'm working on two different systems (deploy jBoss) but they both have a same JSP file.
System 1 : Spring 5 (not SpringBoot)
System 2 : Java Servlet
I had a JSP file that required in both system, however in System 2, it can display correctly, but not in System 1.
This is sample code of the JSP :
<%#page import="com.captcha.botdetect.web.servlet.Captcha"%>
<%
// Adding BotDetect Captcha to the page
Captcha captcha = Captcha.load(request, "exampleCaptcha");
captcha.setUserInputID("captchaCode");
String captchaHtml = captcha.getHtml();
out.write(captchaHtml);
%>
<input id="captchaCode" type="text" name="captchaCode" />
System 2 able display the content correctly , while System 1 show the output as below
System 1 Output
System 1 console error
Compiled JSP
<html lang="en">
<head>
</head>
<!-- JS -->
<script src="js/jquery-3.6.1.min.js"></script>
<script src="js/bootstrap.js"></script>
<body style="padding-top: 0px;">
<div>
<link type="text/css" rel="stylesheet" href="/xxx/botdetectcaptcha?get=layout-stylesheet&t=1676386800" />
<div class="BDC_CaptchaDiv " id="xxx_CaptchaDiv" style="width: 280px !important; height: 50px !important; "><!--
--><div class="BDC_CaptchaImageDiv" id="xxx_CaptchaImageDiv" style="width: 250px !important; height: 50px !important;"><!--
--><div class="BDC_CaptchaImageDiv" style="width:250px; height:40px;"><img class="BDC_CaptchaImage" id="webrf_CaptchaImage" src="/xxx/botdetectcaptcha?get=image&c=xxx&t=29c62e67e7cd426a947e50715ca9b172" alt="Retype the CAPTCHA code from the image" style="" /></div><!--
-->What is BotDetect Java CAPTCHA Library?<!--
--></div><!--
--><div class="BDC_CaptchaIconsDiv" id="webrf_CaptchaIconsDiv" style="width: 24px !important;"><!--
--><a class="BDC_ReloadLink" id="webrf_ReloadLink" href="#" title="Change the CAPTCHA code"><img class="BDC_ReloadIcon" id="webrf_ReloadIcon" src="/xxx/botdetectcaptcha?get=reload-icon" alt="Change the CAPTCHA code" /></a><!--
--><a rel="nofollow" class="BDC_SoundLink" id="xxx_SoundLink" href="/xxx/botdetectcaptcha?get=sound&c=xxx&t=29c62e67e7cd426a947e50715ca9b172" title="Speak the CAPTCHA code"><img class="BDC_SoundIcon" id="xxx_SoundIcon" src="/xxx/botdetectcaptcha?get=sound-icon" alt="Speak the CAPTCHA code" /></a><!--
--><div class="BDC_Placeholder" id="webrf_AudioPlaceholder"> </div><!-- --></div>
<script src="/xxx/botdetectcaptcha?get=script-include&c=xxx&t=29c62e67e7cd426a947e50715ca9b172" type="text/javascript"></script>
<input type="hidden" id="BDC_VCID_webrf" name="BDC_VCID_webrf" value="29c62e67e7cd426a947e50715ca9b172" />
<input type="hidden" id="BDC_BackWorkaround_webrf" name="BDC_BackWorkaround_xxx" value="0" />
<input type="hidden" id="BDC_Hs_xxx" name="BDC_Hs_xxx" value="0fa7d8412e64206ef6b3c1612ed99e7086b1b59c" />
<input type="hidden" id="BDC_SP_xxx" name="BDC_SP_xxx" value="1436062766" />
</div>
<input id="captchaCode" type="text" name="captchaCode" />
</div>
</html>
I had try to print the JSP and Servlet version, both system return the same value
Server Version: WildFly Full 19.1.0.Final (WildFly Core 11.1.1.Final) - 2.1.0.Final
Servlet Version: 4.0 JSP Version: 2.3
I also try with different browser but still no hope .
So I wonder is there anything I can check or any master can help on this ?

Related

When Jcrop handle more than one image, the size is incorrect

1,
2,
Question:When do we change images dynamically ?
Answer: When user asynchronously upload images, such as using ajaxfileupload.js.
when a user upload one image, and want to upload another one.
If he uses Jcrop, the later images are all shown in size of the first image.
even though he uses following jQuery code to change the size of the new image, it`s still in wrong size.
$("#target").attr("width","400");
$("#target").attr("height","250");
Does anyone know how to use Jcrop and show each images in its real size? I mean when the images is dynamically changed.
Thanks a lot!
The souce code is compressed into a zip file, they are all font-end code, so you may open it once it`s unzipped, please open "crop.html"
you may download the zip file (214KB) here:
download
the content of "crop.html" is:
<!DOCTYPE html>
<html lang="en">
<head>
<script src="js/jquery.min.js"></script>
<script src="js/jquery.Jcrop.js"></script>
<script type="text/javascript">
jQuery(function($) {
var jcrop_api;
initJcrop();
$('#coords').on('change', 'input', function(e) {
var x1 = $('#x1').val(),
x2 = $('#x2').val(),
y1 = $('#y1').val(),
y2 = $('#y2').val();
jcrop_api.setSelect([x1, y1, x2, y2]);
});
function initJcrop() {
$('#target').Jcrop({
onChange: showCoords,
onSelect: showCoords,
onRelease: clearCoords
}, function() {
jcrop_api = this;
});
};
$('#changeToWiderPicture').click(function(e) {
jcrop_api.destroy();
$("#target").attr("src", "img/2.jpg");
$("#target").attr("width", "400");
$("#target").attr("height", "250");
$("#normalPicture").attr("src", "img/2.jpg");
$("#normanPicureIntroduction").html("Original picure:400X250");
$('#changeToWiderPicture').hide();
$('#changeBack').show();
initJcrop();
return false;
});
$('#changeBack').click(function(e) {
jcrop_api.destroy();
$("#target").attr("src", "img/1.jpg");
$("#normalPicture").attr("src", "img/1.jpg");
$("#normanPicureIntroduction").html("Original picure:250X400");
$('#changeBack').hide();
$('#changeToWiderPicture').show();
initJcrop();
return false;
});
});
function showCoords(c) {
$('#x1').val(c.x);
$('#y1').val(c.y);
$('#x2').val(c.x2);
$('#y2').val(c.y2);
$('#w').val(c.w);
$('#h').val(c.h);
};
function clearCoords() {
$('#coords input').val('');
};
</script>
<link rel="stylesheet" href="css/main.css" type="text/css" />
<link rel="stylesheet" href="css/demos.css" type="text/css" />
<link rel="stylesheet" href="css/jquery.Jcrop.css" type="text/css" />
</head>
<body>
<table>
<tr>
<td>
<img src="img/1.jpg" id="target" />
<br>Picture with Jcrop attached
</td>
<td width=40%></td>
<td>
<img src="img/1.jpg" id="normalPicture" />
<br>
<span id='normanPicureIntroduction'>Original picure:250X400</span>
</td>
</tr>
</table>
<form id="coords" class="coords">
<div class="inline-labels">
<label>X1
<input type="text" size="4" id="x1" name="x1" />
</label>
<label>Y1
<input type="text" size="4" id="y1" name="y1" />
</label>
<label>X2
<input type="text" size="4" id="x2" name="x2" />
</label>
<label>Y2
<input type="text" size="4" id="y2" name="y2" />
</label>
<label>W
<input type="text" size="4" id="w" name="w" />
</label>
<label>H
<input type="text" size="4" id="h" name="h" />
</label>
</div>
</form>
<div style="padding-top:20px;">
<button id="changeToWiderPicture" class="btn btn-mini">changeToWiderPicture</button>
<button id="changeBack" class="btn btn-mini" style="display:none;">changeBack</button>
</div>
</body>
</html>
I find a solution from another answer on another question:
use -
$('#image').removeAttr('style');
Or simply overwrite the corresponding CSS style, for example -
$("#target").css({"width":"400px" ,"height":"250px"});
please be aware:
CSS style has a higher priority than the attribute, so sometimes, you find your change does not apply, for example -
$("#target").attr("width","400");
$("#target").attr("height","250");
So, for safer, user CSS style instead of an attribute.

recaptcha integration with Spring MVC

I am trying to integrate recaptcha into my spring mvc application. Below is the code.
#RequestMapping(value="home.htm", method=RequestMethod.POST)
public String processEmailLogin(
#ModelAttribute("examLoginForm") ExamLoginDetails examLoginDetails,
BindingResult result,
Model model,
#RequestParam("recaptcha_challenge_field") String challangeField,
#RequestParam("recaptcha_response_field") String responseField,
HttpServletRequest request, SessionStatus sessionStatus) {
ReCaptchaImpl reCaptcha = new ReCaptchaImpl();
reCaptcha.setPrivateKey("6LcWOOsSAAAAAM48WFr4PfE0Y1LdTJHKC_BxILwl");
/*String challenge = request.getParameter("recaptcha_challenge_field");
String response = request.getParameter("recaptcha_response_field");*/
String remoteAddr = request.getRemoteAddr();
logger.info("Remote machine IP address is : "+remoteAddr);
String emailIdForm = request.getParameter("email");
ReCaptchaResponse reCaptchaResponse = reCaptchaService.checkAnswer(remoteAddr, challangeField, responseField);
logger.info("Shown captcha is : "+challangeField);
logger.info("Entered captcha is : "+responseField);
logger.info("The validated recaptcha response is : "+reCaptchaResponse.isValid());
boolean correctAnswer = false;
correctAnswer = challangeField.equalsIgnoreCase(responseField);
logger.info("Correct answer : "+correctAnswer);
logger.info(":::::: LOADED Login Form CONTROLLER ::::::");
if(!reCaptchaResponse.isValid()) {
model.addAttribute("message", "wrong captcha");
logger.info("Incorrect captcha");
return "login/login";
}
else {
logger.info("::::: Checking captcha response to validate :::::");
model.addAttribute("message", "correct captcha");
LoginService loginService = (LoginService) ctx.getBean("loginService");
examLoginDetails = loginService.performLogin(emailIdForm);
logger.info("Email id is ::::::::::: "+examLoginDetails.getEmailId());
return "home/home";
}
}
My JSP form is as follows:
<%# page import="net.tanesha.recaptcha.ReCaptcha" %>
<%# page import="net.tanesha.recaptcha.ReCaptchaFactory" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="./jsp/scripts/jquery-1.9.1.js"></script>
<script type="text/javascript" src="./jsp/scripts/jquery-ui-1.10.3.custom.min.js"></script>
<link rel="stylesheet" type="text/css" href="./jsp/styles/jquery-ui-1.10.3.custom.min.css" />
<link rel="stylesheet" type="text/css" href="./jsp/styles/page-style.css" />
<link rel="stylesheet" type="text/css" href="./jsp/styles/tooltip.css" />
</head>
<body>
<form action="home.htm" method="post" name="examLoginForm">
<fieldset class="ui-widget ui-widget-content ui-corner-all">
<legend class="ui-widget-header ui-corner-all">Online Examination</legend>
<table class="ui-widget ui-helper-clearfix">
<tr>
<td><label for="email">Please enter your Email Id : </label></td>
<td><input class="ui-widget-content ui-corner-all" type="text" id="emailId" name="email" title="Please provide the email id you used to register with us to take the exam." ></td>
</tr>
<tr>
<td></td>
<td>
<script type="text/javascript" src="http://www.google.com/recaptcha/api/challenge?k=PUBLIC_KEY"></script>
<noscript>
<iframe src="http://www.google.com/recaptcha/api/noscript?k=PUBLIC_KEY" height="300" width="500" frameborder="0"></iframe><br>
<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
<input type="hidden" name="recaptcha_response_field" value="manual_challenge">
</noscript>
<%-- <%
ReCaptcha c = ReCaptchaFactory.newReCaptcha("PUBLIC_KEY","PRIVATE_KEY", false);
out.print(c.createRecaptchaHtml(null, null));
%> --%>
</td>
<td></td>
</tr>
<tr>
<td></td>
<td><span id="LoginBtn"><input class="ui-helper-clearfix ui-corner-all ui-button ui-button-text ui-state-default ui-state-focus ui-state-active ui-state-hover" type="submit" id="login" value="Take Exam" /></span></td>
<td></td>
</tr>
</table>
</fieldset>
</form>
<div id="dialog" title="Confirm Your Email ID">
<p><span class="ui-widget ui-widget-content ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>Are you sure that this is the Email Id you have used to register yourself with us?</p>
</div>
</body>
</html>
The bean configuration in the spring application context is :
<bean id="reCaptchaService" class="net.tanesha.recaptcha.ReCaptchaImpl">
<property name="privateKey" value="PRIVATE_KEY" />
</bean>
The output i see on my console is :
13:12:56,875 INFO LoginFormController:58 - Remote machine IP address is : 10.129.75.57
13:12:57,078 INFO LoginFormController:63 - Shown captcha is : 03AHJ_VuuVrDXTjd0tBEkuONNedE6Bk214GxuOj7DT0o927e5HNgS_IKX7Efuc79liUvsH8VbKbZ7aZ8iElpJog6YqjsvThFu3BuULzPGEPHZKiIk_hnix6N_IXC3aDQaEcBDTPgooOuqs_CwriWe8PuxrzfbzDS2QdnhLuiWqIVqlX2KnZT9BZYo
13:12:57,078 INFO LoginFormController:64 - Entered captcha is : 44642526 2154
13:12:57,079 INFO LoginFormController:65 - The validated recaptcha response is : false
13:12:57,079 INFO LoginFormController:70 - Correct answer : false
13:12:57,079 INFO LoginFormController:71 - :::::: LOADED Login Form CONTROLLER ::::::
13:12:57,079 INFO LoginFormController:79 - ::::: Checking captcha response to validate :::::
What i see from the console output is that the recaptcha_challange_field contains the captcha question in some encripted form and the recaptcha_response_field contains the response for the captcha question in plain text form. So, is it the reason that the recaptcha checkAnswer(remoteAddr, challange, response) method is always evaluating to false?.
Please help me as i am stuck with this problem from a long time now.
For me recaptcha-spring-boot-starter was very helpful and reduces your code a lot:
https://github.com/mkopylec/recaptcha-spring-boot-starter-samples

How do I modify a .html file to give hardcoded inputs to input fields every time?

I want to access my Powerschool (powerschool.avon.k12.ct.us), and I find the need to type in my password and username every time rather tedious. To try and fix this I downloaded the page's source in Chrome, below:
<!DOCTYPE html>
<!-- saved from url=(0052)http://powerschool.avon.k12.ct.us/guardian/home.html -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Parent Sign In</title>
<meta http-equiv="X-UA-Compatible" content="IE=8">
<meta name="robots" content="noindex">
<link href="./Powerschool_files/screen.css" rel="stylesheet" type="text/css" media="screen">
<meta name="viewport" content="width=device-width">
<script src="./Powerschool_files/jquery-1.4.2.min.js"></script><style type="text/css"></style>
<script language="JavaScript" src="./Powerschool_files/md5.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript"><!--
var pskey = "4EDE156E2FAD0F1A427D2AD066530F496ADC3EEA78CE43E70F28053576FD4EA1";
//-->
</script>
<script language="JavaScript" type="text/javascript">
function deleteCookie(cookieName){
var cookieDate = new Date();
cookieDate.setTime(cookieDate.getTime()-1);
document.cookie = cookieName + "=; expires='" + cookieDate.toGMTString()+"'; path=/";
}
deleteCookie("InformAuthToken");
function getURLParameter(name) {
return unescape(
(RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]
);
}
var $j = jQuery.noConflict();
$j(document).ready(function() {
// Hide or show the translator login input field
// if the URL parameter "translator" is present
var translator = getURLParameter("translator");
if (translator == "null") {
$j('#translatorInput').hide();
} else {
if (translator == "true") {
$j('#translatorInput').show();
} else {
$j('#translatorInput').hide();
}
}
$j('a.popWin').click(function(){
var winURL = $j(this).attr('href');
window.open(winURL);
return false;
});
});
</script>
</head>
<body class="pslogin" id="palogin">
<div id="container">
<div id="branding-powerschool"><img src="./Powerschool_files/ps7-logo-lrg.png" alt="PowerSchool" width="280" height="41"></div>
<div id="content" class="group">
<form action="./Powerschool_files/Powerschool.htm" method="post" name="LoginForm" target="_top" id="LoginForm" onsubmit="doPCASLogin(this);">
<input type="hidden" name="pstoken" value="2465670387a1nxrEimrKqPMN0c7QbxxKLNZe16PRC">
<input type="hidden" name="contextData" value="4EDE156E2FAD0F1A427D2AD066530F496ADC3EEA78CE43E70F28053576FD4EA1">
<input type="hidden" name="dbpw" value="">
<input type="hidden" name="translator_username" value="">
<input type="hidden" name="translator_password" value="">
<input type="hidden" name="translator_ldappassword" value="">
<input type="hidden" name="returnUrl" value="">
<input type="hidden" name="serviceName" value="PS Parent Portal">
<input type="hidden" name="serviceTicket" value="">
<input type="hidden" name="pcasServerUrl" value="/">
<input type="hidden" name="credentialType" value="User Id and Password Credential">
<h2>Parent Sign In</h2>
<!--box content-->
<div id="noscript" class="feedback-alert" style="display: none;"> To sign in to PowerSchool, you must use a browser that supports and has JavaScript enabled. </div>
<fieldset id="login-inputs" class="group">
<div>
<label>Username</label>
<input type="text" id="fieldAccount" name="account" value="" size="39">
</div>
<div>
<label>Password</label>
<input type="password" name="pw" value="" size="39"><div id="login-help">Having trouble signing in?</div>
</div>
<div id="translatorInput" style="display: none;">
<label>Translator Sign In</label>
<input type="password" name="translatorpw" value="" size="39">
</div>
<div class="button-row">
<button type="submit" id="btn-enter" title="Sign In To PowerSchool Parent Access" value="Enter" border="0">Sign In</button>
</div>
</fieldset>
<!-- box content-->
</form>
</div>
<div id="footer" class="group">
<p>Copyright© 2005 - 2013 Pearson Education, Inc., or its affiliate(s). All rights reserved.</p>
<p id="pearsoncorplink">Join us on Facebook</p>
</div>
</div>
<div id="branding-pearson">
<div id="logo-pearson"></div>
<div id="tagline-pearson"></div>
</div>
<script type="text/javascript">
/**
* Set the page's locale via a request_locale URL parameter. If there is already a URL parameter by
* this name, then substitute it with the passed-in locale. NOTE: This function will actually cause the page
* to be re-submitted with the new locale, so it really should not be used with pages submitted via POST
* requests (if there are any, which I hope there are not).
* #param locale the locale to set (e.g. en_US)
*/
function setPageLocale (locale) {
var c=String (window.location);
var rlpos = c.indexOf("request_locale=");
var afterPart = "";
if (rlpos > 0) {
var afterBegin = c.indexOf("&", rlpos);
if (afterBegin > 0) {
afterPart = c.substring(afterBegin);
}
c = c.substring(0, rlpos-1);
}
var s=(c.indexOf('?') > 0 ? '&' : '?');
var np = c + s + 'request_locale=' + locale + afterPart;
window.location = np;
}
function jsCheck() {
document.getElementById("login-inputs").className = 'group';
}
jsCheck();
</script>
<script>
$j('#noscript').hide();
function jsEnabled() {
if(typeof $j != 'function'){
alert('Developer: This page is missing key components required for functionality!\n\nPossible causes include:\n - Commonscripts might be missing.\n - Page customization might enabled, and incomplete.');
//document.write('<script...');
} else {
$j('#login-inputs').removeClass('hide');
$j("#fieldAccount").focus();
}
}
$j(document).ready(function(){
jsEnabled();
});
</script>
</body></html>
I was wondering if it was possible to directly modify the downloaded source to automatically fill the input boxes (the below block is where I think it would be done) to always fill in the username and pass fields with "myUsername" and "myPassword," or something like that. I tried setting the value of the Input and Username fields, but that (chrome) gave me an, shown here:
No webpage was found for the web address: file:///C:/Users/Me/Desktop/Powerschool_files/Powerschool.htm
Error 6 (net::ERR_FILE_NOT_FOUND): The file or directory could not be found.
Do you guys know how this could be done?
Instead of copying the entire page, it's probably simpler to make a bookmarklet that fills in the form. Just edit a normal bookmark and change the link to be this:
javascript:(function() { document.forms[0].elements[0].value="hi" })()
That will set the value of the first field in the first form. (It may take some experimenting to see which form number and which field number.)
You can probably use Chrome to remember your passwords for you automatically, but what you have should actually work. You just need to change any paths to urls for it to work perfectly. One that you definitely need to change is the form action:
- ./Powerschool_files/Powerschool.htm
+ https://example.com/Powerschool_files/Powerschool.htm
This should allow you to submit directly to that site unless they have a CSRF token in the form that I don't see.

Magento - newsletter pop code using ajax update in form

I have the below code that is being used in cms page pop up
the problem im having is if you leave email address input field blank and hit the submit (in the case "Get Code" button, you briefly see the red validation message but then hides the form, shows the hidden div.
why or how can I prevent this process, i want it to validate but proceed to show the hidden div content. Below is the code.
<div id="pop-confirm" style="display: none;">
<h1 style="color: #000000; font-weight: bold;">THANKS!</h1>
<p> </p>
<h2>Use code: <strong>extra15</strong><br /> for 15% off your purchase.</h2>
</div>
<form id="newsletter-validate-detail" action="home/send" method="post" onSubmit="new Ajax.Updater({success:'newsletter-validate-detail'}, 'newsletter/subscriber/new', {asynchronous:true, evalScripts:false, onComplete:function(request, json){Element.hide('newsletter-validate-detail');Element.show('pop-confirm');}, onLoading:function(request, json){}, parameters:Form.serialize(this)}); return false;">
<div class="block-content">
<h2>ENTER YOUR EMAIL<br /> AND GET</h2>
<div class="form-subscribe-header">
<h1>15% OFF</h1>
<br />
<h1>EVERYTHING!</h1>
</div>
<div class="input-box"><input id="newsletter" class="input-text required-entry validate-email" title="Sign up for our newsletter" type="text" name="email" /></div>
<br />
<div class="actions"><button class="button" title="Get Code" type="submit"><span><span>Get Code</span></span></button></div>
<br />
<p><em>* Promotion ends April 6th</em></p>
</div>
</form>
<script type="text/javascript">// <![CDATA[
var newsletterSubscriberFormDetail = new VarienForm('newsletter-validate-detail');
// ]]></script>
Im very new to ajax so maybe ive done something wrong.
any ideas or suggestion would be greatly appreciated.
Thanks
Try changing your onSubmit to the following:
onSubmit="if(newsletterSubscriberFormDetail.validator.validate()){ new Ajax.Updater({success:'newsletter-validate-detail'}, 'newsletter/subscriber/new', {asynchronous:true, evalScripts:false, onComplete:function(request, json){Element.hide('newsletter-validate-detail');Element.show('pop-confirm');}, onLoading:function(request, json){}, parameters:Form.serialize(this)}); } return false;"`
This wil trigger the validator before submitting the form with AJAX. Works perfect for me :)

ajax result div refresh in struts2

i Have an use case
<html>
<head>
<s:head />
<sj:head jqueryui="true" />
<script type="text/javascript">
$.subscribe('hideTarget', function(event, data) {
$('#'+event.originalEvent.targets).hide("blind");
});
</script>
</head>
<body>
<div align="left" >
<div class="demo" align="center">Run Effect</div>
<div id="effect" style="display:none;">
Upload Photos Here
<s:form action="AjaxTest" method="post" theme="xhtml" enctype="multipart/form-data" >
<s:file name="userImage" label="User Image" />
<sj:submit targets="result" effect="blind" effectMode="show" onEffectCompleteTopics="hideTarget" value="Upload" button="true" />
</s:form>
<br/>
<img id="indicator" src="progressbar.gif" style="display:none" alt="loading"/>
</div>
<sj:div effect="pulsate" effectDuration="1500" onEffectCompleteTopics="hideTarget" cssClass="welcome" id="result"></sj:div>
</div>
<!-- End demo -->
</body>
as u can see i am uploading an single file using ajax call. when u click Run Effect link a div will toggle down in that file tag willbe their, select the file, upload it and it will display successfully uploaded message with effect and after it hide that success message.
up to that it work fine but my problem is when u want to upload another file it will display file tag u can select also but when u submit the form it is not displaying an successful message but file is uploaded in server and also in file tag previous uploaded file name is their
NOTE: my requirement is it should show successfully uploaded message for each and every time user submits form using ajax call
my success.jsp is
<body>
<s:if test="hasActionMessages()">
<s:actionmessage/>
</s:if>
<s:if test="hasActionErrors()">
<s:actionerror/>
</s:if>
</body>
Struts.xml
<action name="AjaxTest" class="AjaxCallAction">
<result name="success">/success.jsp</result>
</action>
just like the link below this
http://www.weinfreund.de/struts2-jquery-showcase/index.action
Dont use id="result" in , use name="result" and use formIds in

Resources