Would like to request an object using java file how to do [Original]

2010-12-11  来源:本站原创  分类:Java  人气:127 

Sometimes we want to use the request object java file, but the jsp page is running in the web container, so we can get the value of it. request object and session object is a built-in objects jsp page ah. But, you do not use the web in the code provided by the container method to get web container context is no way to call the web container request session application of these objects. That white

Can be used in jsp request object, which in the java file can not be directly used to!

Then how in java there is the use?

Jsp to java files can be passed in the past!

In the jsp page that says;

telgoto telgotoObj = new telgoto ();
telgotoObj.getRequest (request);

Then in that class to use to telgoto.java which reads:

HttpServletRequest request;

public void getRequest (HttpServletRequest requestin) {

request = requestin;

}

Then you can use it!

相关文章
  • Would like to request an object using java file how to do [Original] 2010-12-11

    Sometimes we want to use the request object java file, but the jsp page is running in the web container, so we can get the value of it. request object and session object is a built-in objects jsp page ah. But, you do not use the web in the code provi

  • How to get an object in java reflection all the property values 2010-09-22

    How to get an object in java reflection of all property values, hope expert enlighten!

  • Java file operations 2010-03-29

    This collection of common file operations methods, including file creation / check and delete, directory creation / check and delete, remove files in the directory, file properties to acquire, read data line by line and so on. Documents establish / c

  • Java file operations method 2010-03-29

    Transfer from the following code: http://lionelxx777.javaeye.com/blog/358128 Java file operations to the text of the two methods. 1. The usual practice is to use FileInputStream and FileOutputStream to carry out operations, the above two categories r

  • Using java file input stream and file output stream for file read and write use cases! 2010-06-20

    package com.test.io; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; / ** * * @ Author Ad

  • Garbled Eclipse JAVA file comments 2010-03-29

    For someone else's project or JAVA files into its own when Eclipse often JAVA file will appear garbled in Chinese notes the case, largely because of someone else's IDE encoding format and encoding format different from their own Eclipse. Can refer to

  • java file write operation 2010-03-29

    package com.test2; import java.io.*; /** * @desc java File write operations * @author zhaozhi3758 * */ public class FileWriteT { // The following method file is created automatically public void writeToFile1(String path,String str) throws FileNotFoun

  • Java file operations enhancement tools 2010-03-29

    Java file operations enhancement tools -------------------------------------------------- ------------------------------ 2008-12-15 18:30:43 Tags: File IO commons [pushed to the technical ring] Copyright Statement: original works, and if reproduced,

  • Java file download in several ways 2008-05-15

    Java file download in several ways public HttpServletResponse download(String path, HttpServletResponse response) { try { // path Refers to download the file path . File file = new File(path); // Get the file name . String filename = file.getName();

  • encoding one of the Java file encoding 2010-05-08

    1. Edit *. java file what happened then? A: When we use Notepad to edit, Open the purple input, purple keyboard input software control from the keyboard to become a phonetic alphabet, alphabet below shows the GBK Simplified or Traditional determined

  • Java file operations on the Properties Summary 2010-05-13

    Frequently used, Java file operations on the Properties, to make a summary here. Java Properties files on the operation to be "unsatisfactory", said here about the first time in general, back slowly said. 1.java read Properties files, often worn

  • Eclipse set the java file of the author, date, etc. Note 2010-07-26

    Window-"Ppreference-" Java-"Code Styple-" Code Templates The right point to open Comments, select Files, click the edit: Java code /************************************************* ********************** * * @ Package: $ (package_name

  • Eclipse set the java file of the author, date and other instructions 2010-07-26

    Window-"Ppreference-" Java-"Code Styple-" Code Templates The right point to open Comments, select Files, click the edit: Java code /************************************************* ********************** * * @ Package: $ (package_name

  • java proxy --- the first step, dynamic compilation java file 2010-10-16

    Assume that we have a dynamically generated string type the following statement of a class String src = "package com.wjj.myproxy;" + "Public class CarTimeProxy implements Moveable {" + "Moveable car = null;" + "Public Ca

  • Java file in Notepad and the difference between line (turn) 2010-10-27

    And today they made a java file reading and writing about the issue, originally thought to java database ok, but now look, the file read and write, thread and other issues are all very important, ah! ! Oh, well cut to the chase, today's problem is th

  • swfUpload java file upload component upload.war 2010-10-28

    swfUpload java file upload component upload.war placed directly under the webapps directory. Upload file exists webapps \ upload \ files directory upload_src.rar Eclipse project source code Support for multiple file upload.

  • java file encoding conversion 2010-12-03

    package com.xw.file; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileFilter; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream

  • java file reading and writing Daquan 2010-12-05

    Text file using the Java method operating Detailed Summary: java does not support the original text files for processing, in order to compensate for this deficiency was introduced in the first two classes Reader and Writer java does not support the p

  • Java file using the JAD decompiler good light JAVA _ 2011-01-09

    Java file using the JAD decompiler September 2, 2007 Sunday, 02:22 AM Recently drawn the short straw, the computer system unit accidentally hang out, and restore the system also failed, the most terrible is when colleagues in restoring my machine to

  • How to use CXF. Wsdl file into a java file 2011-07-27

    How to use CXF. Wsdl file into a java file Have not previously had contact with webservice development, the two barely beginning to see, customers. Wsdl file, I want to convert. Java files in the Internet is a lot of information, and finally pass the