Skip to main content

Posts

Showing posts with the label struts2

How to download a doc file using struts 2.x

I have a requirement that i have to download a .Doc file from batabase and show to the user. So I am using struts 2.x and SQL server as my database. so we ever user enters a password , user can able to see his doc file which is going to fetch from the database. Please can you provide me a sample example for the above requirement. Thanks in Advance.

Ajax call response in struts. Response not reflected in jsp.

I am calling a struts action on using an ajax call. In it i am changing the values of some properties of the action class. The values are set properly but i am not able to reflect the changes in the jsp. The jsp code is as follows. <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@ taglib prefix="s" uri="/struts-tags"%> <html> <head> function findindex1() { var temp=document.getElementById("country").value; if(window.ActiveXObject){ request = new ActiveXObject("Microsoft.XMLHTTP"); } else if(window.XMLHttpRequest){ request = new XMLHttpRequest(); } request.onreadystatechange = showResult; request.open("POST",'temp.action?index='+temp,true); request.