java - Why am i not getting initialize HttpServletRequest object in Struts2 Action? -


I am facing a problem with the struts2 framework I get the data of the axle file in the Action class from the HTML form Want to But I am able to find the HttpServletRequest object to get the inputstream of this request. I am also implementing the ServalCounterAvr interface in my action class of Straits 2. My code is being displayed in ............

  import com.opensymphony.xwork2.Action; Import com.opensymphony.xwork2.ActionSupport; Import java.io.IOException; Import javax.servlet.ServletInputStream; Import javax.servlet.http.HttpServletRequest; Import org.apache.struts2.interceptor.ServletRequestAware; Import jxl *; Import jxl.read.biff.BiffException; Public Square UpdateZflexRecordsAction ActionSupport applies ServletRequestAware {/ ** * * / Private static last long serial VERSIONUID = 1 L; Private Boolean results = False; Private string position = zero; Private string msg = null; Private ServletInputStream inputstream = faucet; Private HttpServletRequest Request = Zero; Public string getStatus () {return status; } Public Zero setstats (string position) {this.status = status; } Public string getMsg () {return msg; } Public Zero Set Message (String msg) {this.msg = msg; } Execute public string () {try {inputstream = getServletRequest} GetInputStream (); Byte [] junk = new byte [1024]; Int BitesRad = 0; // Strip the HTTP notification from the input stream / request the first four rows, junk bytes read = inputstream.readline (junk, 0, junk lamps); Bytes = inputstream Readline (junk, 0, junk lamps); Bytes = inputstream Readline (junk, 0, junk lamps); Bytes = inputstream Readline (junk, 0, junk lamps); // Create the workbook object from the ServletInputStream workbook workbook = Workbook. Tag (inputstream); Sheet Sheet = Workbook.Set (0); Cell cell = null; Println (sheet.getName ()); } Grip (IOException E) {// TODO Auto-Generated Catch Block e.printStackTrace (); } Grip (buffex E) {// TODO auto-generated catch block e.printStackTrace (); } If (the result) {this.setStatus ("success"); This.setMsg ("Congratulations! Your request has been accepted."); } And {this.setStatus ("feld"); This.setMsg ("Sorry your request has not been accepted."); } Return action. } Public Zero Set ServletRequest (HttpServletRequest Request) {this.request = Request; } Public HttpServletRequest getServletRequest () {this return.request; }}   

I am very confused with this issue how to get examples of HTRRASTATE object and I get another error on the console -

  information: Javax.servlet.context.tempdir   

and unable to find property settings 'struts.multipart.saveDir' and the strut.xml file being given below Is -

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt ;! DOCTYPE STRUTS PUBLIC "- // Apache Software Foundation // DTD Stropes Configuration 2.1 /" "http://struts.apache.org/dtds/struts-2.1.dtd"> & Lt; Struts & gt; & Lt; Constant name = "struts.devMode" value = "true" /> & Lt; Constant name = "struts.multipart.maxis" value = "10000000" /> & Lt; Package name = "default" Expand = "Straits-default, Jason-default" namespace = "/" & gt; & Lt; Action Name = "DownloadJfx Format" class = "SadaGi.M.Proction.RootMapper" method = "DownloadJax Format Action" & gt; & Lt; Interceptor-Rif name = "Access Required" /> & Lt; Interceptor-rif name = "scope" /> & Lt; Name of the result = "Login" type = "redirect" & gt; / & Lt; / Results & gt;   

Please solve any suggestions. Thanks for giving you a little past.

You defaultStack .

  & lt; Action Name = "DownloadJax Format" Category = "sadagi.my.softhuman.action.RootMapper" method = "DownloadJax Format Action" & gt; & Lt; Interceptor-Rif name = "Access Required" /> & Lt; Interceptor-rif name = "scope" /> & Lt; Interceptor-Rif = "Default Stock" /> & Lt; Name of the result = "Login" type = "redirect" & gt; / & Lt; / Results & gt;   

Your action has been applied because the ServletRequestAware action example will be populated from the example HttpServletRequest object example.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -