Home > Back-end >  Access to parts of the project. The JSP file into a prompt to download, please have a look
Access to parts of the project. The JSP file into a prompt to download, please have a look

Time:11-01

I have just arrived in the company to work for two months and are following up a small upgrade project, met this problem in the past two days, baidu for two days no clue, please help to look at:
a, first of all, if the normal operation of program flow is like this:

(figure 1)
and then pops out the following page:


this is when other machines running on the server, but the same code on my machine becomes:
One, click the same link:


2, but here I didn't show the expected web content, instead of prompting the download file!


online for two days, basically all the JSP file & lt; % @ page contentType=* * * * * % & gt; Within the code is wrong, I have carefully checked, my application & lt; % @ page contentType=* * * * * % & gt; No error within the code, and the key is the same code in the company's normal operation of other machines, to me that there is a problem, don't think the code is wrong, but I'm running environment, now I guess is most likely to be server "tomcat", the second is the IDE: "eclipse" configuration problem, but the level is limited, got two days no problem, please help to look at, urgent

CodePudding user response:

Compile compile files under tomcat, redeployment

CodePudding user response:

Oh, thank you, I am a novice, and I of this project from 'CVS' import, bother specifically how to put the "tomcat compiled under the compiled file clean up"?

CodePudding user response:

Oneself the top posts don't heavy,

CodePudding user response:

reference tanlehua reply: 3/f
oh, thank you, I am a beginner, and I of this project from 'CVS' import, bother specifically how to put the "tomcat compiled under the compiled file clean up"?


This is two different things. CVS is a version control tool, is to control the version of the code.

You locally run this to rev a tomcat server.

CodePudding user response:

reference 5 floor qq_35209952 reply:
Quote: refer to the third floor tanlehua response:

Oh, thank you, I am a novice, and I of this project from 'CVS' import, bother specifically how to put the "tomcat compiled under the compiled file clean up"?


This is two different things. CVS is a version control tool, is to control the version of the code.

You locally run this to rev a tomcat server.


yes, I am running on the local tomcat, but can you tell me the problem of how to solve? Is I put it on this post one upstairs, the same code in other colleagues on the machine running normally, but on my machine when accessing a certain JSP page does not show the expected page content, it pops up a "download prompt out?"

CodePudding user response:

refer to the second floor yuxiangaaaaa response:
compile compile files under tomcat, redeploy the

Excuse me "tomcat compiler compiled file clean up", this how to operate, is in eclipse or direct manual operation to find corresponding to delete the compiled file folder receive?

CodePudding user response:

Tomcat/webapps folder of your project directly to delete the folder

CodePudding user response:

refer to 7th floor tanlehua response:
Quote: refer to the second floor yuxiangaaaaa response:

Compile compile files under tomcat, redeploy the

Excuse me "tomcat compiler compiled file clean up", this how to operate, is in eclipse or direct manual operation to find corresponding to delete the compiled file folder receive?


Yes, under the webapps named after the corresponding project folder to delete, redeployment

CodePudding user response:

Oneself the top, posts don't heavy

CodePudding user response:

Again, don't sink

CodePudding user response:

Js writing has a problem

CodePudding user response:

See if the JSP file & lt; Meta HTTP - equiv="content-type" Content="text/HTML. Charset=utf-8 "& gt; Problem, this is the right setting browser wouldn't way HTML to parse the file

CodePudding user response:

The
reference 13 floor harrydeep reply:
look at whether the JSP file & lt; Meta HTTP - equiv="content-type" Content="text/HTML. Charset=utf-8 "& gt; Problem, this is the right setting browser wouldn't way HTML to parse the file

This solution on baidu I have ever seen, I carefully watched it again the JSP file code, there is no wrong, in addition, I think I should not project in the JSP file problem, because if it is, then on my machine via IP access to other colleagues of the same code on the machine project, should also can appear the same problem, but it turned out to visit their machines with the same code page, but it can run normally, so I think it should be my running environment, especially the tomcat configuration has a problem, but I am a novice, nye specific is what reason not found, baidu did not find a solution,

CodePudding user response:

Yesterday found that if the included a "JSP file a & lt; %! % & gt;" Scriptlets "remove won't appear the pop-up download prompt box, but as said in colleagues on other machines if not remove the segment" scriptlets "can still run normally, delete" scriptlets "is as follows:
Public String java2Html (String target)
{
If (target==null) {
return target;
}
Target=target. The trim ();

StringBuffer StringBuffer=new StringBuffer ();
Int j=target length ();
for (int i=0; i {
Char c=target. CharAt (I);
The switch (c)
{
A case of 60:
Stringbuffer. Append (" & amp; Lt;" );
break;
Case: 62
Stringbuffer. Append (" & amp; Gt;" );
break;
A case of 38:
Stringbuffer. Append (" & amp; Amp;" );
break;
A case of 34:
Stringbuffer. Append (" & amp; Quot;" );
break;
Case: 169
Stringbuffer. Append (" & amp; Copy." );
break;
Case: 174
Stringbuffer. Append (" & amp; Reg;" );
break;
Case: 165
Stringbuffer. Append (" & amp; Yen." );
break;
Case: 8364
Stringbuffer. Append (" & amp; Euro." );
break;
Case: 8482
Stringbuffer. Append (" & amp; # 153;" );
break;
Case 13:
If (I & lt; J - 1 & amp; & Target. The charAt (I + 1)==10)
{
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related