嵌入式 Tomcat + Spring 文件上传:HTTP 404 [英] Embedded Tomcat + Spring file-upload: HTTP 404

查看:35
本文介绍了嵌入式 Tomcat + Spring 文件上传:HTTP 404的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我通过 Eclipse 启动它,我可以打开 myApp throw Internet Browser,但是,虽然我可以启动嵌入式服务器 throw 命令行 (java -jar myApp.jar),但我收到了 HTTP 状态 404.可能是上下文的一些问题,但是我不知道出了什么问题.

I can open myApp throw Internet Browser if I start it via Eclipse, but, although I can start the Embedded server throw command line (java -jar myApp.jar) I am getting HTTP Status 404. Probably some issue with context but I can't figure out what is wrong.

请参阅下面 Eclipse 和 myApp.jar 中的结构.该应用程序基本上由 5 个文件组成:两个放置在 com.mycompany.myapp.batchs.AuthFileUpload(App.class 与 main 方法和 FileUploadController.class 作为一个非常简单的控制器).其他三个文件,App-servlet.xml、web.xml和index.jsp放在WEB-INF中.

Kindly, see below the structure in Eclipse and in myApp.jar. The application is basically compound by 5 files: two placed in com.mycompany.myapp.batchs.AuthFileUpload (App.class with main method and FileUploadController.class as a very simple controller). Other three files, App-servlet.xml, web.xml and index.jsp placed in WEB-INF.

其他可能的原因可能是我应该直接指向 "tomcat.addWebapp("/", "the_place_where_classes_can_be_found_in_myApp.jar)" 中的类.如果是这样,我该怎么做?

Other possible reason can be I should point straigh to the classes in "tomcat.addWebapp("/", "the_place_where_classes_can_be_found_in_myApp.jar)". If so, how can I do it?

Index.jsp 和 FileUploadController.java 太简单了,所以在这里展示都没有意义.

Index.jsp and the FileUploadController.java are too simple so it is pointless show both here.

应用类

 public static void main(String[] args) throws IOException,
                 ServletException, LifecycleException {
          Tomcat tomcat = new Tomcat();

          tomcat.setPort(8080);


          tomcat.setBaseDir("C:\\temp\\");
          tomcat.addWebapp("/", "C:\\temp\\");
          tomcat.start();
          tomcat.getServer().await();

   }

应用程序servlet.xml

App-servlet.xml

<context:component-scan base-package="com.mycompany.myapp.batchs.AuthFileUpload" />

<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
 <property name="prefix" value="/WEB-INF/" />
 <property name="suffix" value=".jsp" />
</bean>

<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver" />

web.xml

   <display-name>Spring MVC Application</display-name>
   <servlet>
      <servlet-name>App</servlet-name>
      <servlet-class>
         org.springframework.web.servlet.DispatcherServlet
      </servlet-class>
      <load-on-startup>1</load-on-startup>
   </servlet>

   <servlet-mapping>
      <servlet-name>App</servlet-name>
      <url-pattern>/</url-pattern>
   </servlet-mapping>
</web-app>

POM.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

       <modelVersion>4.0.0</modelVersion>

       <groupId>com.myCompany.myApp.batchs</groupId>
       <artifactId>AuthFileUpload</artifactId>
       <version>0.0.1-SNAPSHOT</version>
       <packaging>jar</packaging>
       <name>AuthFileUpload</name>
       <url>http://maven.apache.org</url>
       <properties>
              <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
              <tomcat.version>8.0.32</tomcat.version>
              <java.version>1.8</java.version>
              <maven.compiler.plugin.version>2.1</maven.compiler.plugin.version>
              <spring.version>4.2.5.RELEASE</spring.version>
       </properties>


       <dependencies>
              <dependency>
                     <groupId>org.springframework</groupId>
                     <artifactId>spring-webmvc</artifactId>
                     <version>${spring.version}</version>
              </dependency>
              <dependency>
                     <groupId>org.apache.tomcat.embed</groupId>
                     <artifactId>tomcat-embed-core</artifactId>
                     <version>${tomcat.version}</version>
              </dependency>
              <dependency>
                     <groupId>org.apache.tomcat.embed</groupId>
                     <artifactId>tomcat-embed-logging-juli</artifactId>
                     <version>${tomcat.version}</version>
              </dependency>
              <dependency>
                     <groupId>org.apache.tomcat.embed</groupId>
                     <artifactId>tomcat-embed-jasper</artifactId>
                     <version>${tomcat.version}</version>
              </dependency>
              <dependency>
                     <groupId>org.apache.tomcat</groupId>
                     <artifactId>tomcat-jasper</artifactId>
                     <version>${tomcat.version}</version>
              </dependency>
              <dependency>
                     <groupId>org.apache.tomcat</groupId>
                     <artifactId>tomcat-jasper-el</artifactId>
                     <version>${tomcat.version}</version>
              </dependency>
              <dependency>
                     <groupId>org.apache.tomcat</groupId>
                     <artifactId>tomcat-jsp-api</artifactId>
                     <version>${tomcat.version}</version>
              </dependency>
              <dependency>
                     <groupId>commons-fileupload</groupId>
                     <artifactId>commons-fileupload</artifactId>
                     <version>1.3.1</version>
              </dependency>


       </dependencies>
       <build>
              <finalName>embeddedApp</finalName>
              <plugins>
                     <plugin>
                           <groupId>org.apache.maven.plugins</groupId>
                           <artifactId>maven-compiler-plugin</artifactId>
                           <version>${maven.compiler.plugin.version}</version>
                           <configuration>
                                  <source>${java.version}</source>
                                  <target>${java.version}</target>
                           </configuration>
                     </plugin>

                     <plugin>
                           <groupId>org.codehaus.mojo</groupId>
                           <artifactId>appassembler-maven-plugin</artifactId>
                           <version>1.1.1</version>
                           <configuration>
<assembleDirectory>target</assembleDirectory>
                                  <programs>
                                         <program>
                                                <mainClass>com.myCompany.myApp.batchs.AuthFileUpload.App4</mainClass>

                                                <name>App4</name>

                                         </program>
                                  </programs>
                           </configuration>
                           <executions>
                                  <execution>
                                         <phase>package</phase>
                                         <goals>
                                                <goal>assemble</goal>
                                         </goals>
                                  </execution>
                           </executions>
                     </plugin>
              </plugins>
       </build>
</project>

***于 2016 年 3 月/04 年添加

***Added in 2016/March/04

*** 添加于 2016 年 3 月/07 年巴西利亚时区下午 5 点

*** Added in 2016/March/07 at 5pm Brasilia timezone

C:\STS\wsRestTemplate\TestDeployment\target>cd ..

C:\STS\wsRestTemplate\TestDeployment>java -version
Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook
java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)

C:\STS\wsRestTemplate\TestDeployment>mvn clean package
Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building AuthFileUpload 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ AuthFileUpload ---
[INFO] Deleting C:\STS\wsRestTemplate\TestDeployment\target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ AuthFileUp
load ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ AuthFileUploa
d ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to C:\STS\wsRestTemplate\TestDeployment\target\c
lasses
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ Au
thFileUpload ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\STS\wsRestTemplate\TestDeployment\
src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:testCompile (default-testCompile) @ AuthF
ileUpload ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ AuthFileUpload ---

[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:2.6:jar (default-jar) @ AuthFileUpload ---
[INFO] Building jar: C:\STS\wsRestTemplate\TestDeployment\target\embeddedApp.jar

[INFO]
[INFO] --- appassembler-maven-plugin:1.10:assemble (default) @ AuthFileUpload --
-
[WARNING] The usage of program name (App) is deprecated. Please use program.id i
nstead.
[INFO] Installing artifact C:\Users\e049447\.m2\repository\org\springframework\s
pring-web\4.2.5.RELEASE\spring-web-4.2.5.RELEASE.jar to C:\STS\wsRestTemplate\Te
stDeployment\target\repo\org\springframework\spring-web\4.2.5.RELEASE\spring-web
-4.2.5.RELEASE.jar
[INFO] Installing artifact C:\Users\e049447\.m2\repository\org\springframework\s
pring-aop\4.2.5.RELEASE\spring-aop-4.2.5.RELEASE.jar to C:\STS\wsRestTemplate\Te
stDeployment\target\repo\org\springframework\spring-aop\4.2.5.RELEASE\spring-aop
-4.2.5.RELEASE.jar
[INFO] Installing artifact C:\Users\e049447\.m2\repository\aopalliance\aopallian
ce\1.0\aopalliance-1.0.jar to C:\STS\wsRestTemplate\TestDeployment\target\repo\a
opalliance\aopalliance\1.0\aopalliance-1.0.jar
[INFO] Installing artifact C:\Users\e049447\.m2\repository\org\springframework\s
pring-beans\4.2.5.RELEASE\spring-beans-4.2.5.RELEASE.jar to C:\STS\wsRestTemplat
e\TestDeployment\target\repo\org\springframework\spring-beans\4.2.5.RELEASE\spri
ng-beans-4.2.5.RELEASE.jar
[INFO] Installing artifact C:\Users\e049447\.m2\repository\org\springframework\s
pring-context\4.2.5.RELEASE\spring-context-4.2.5.RELEASE.jar to C:\STS\wsRestTem
plate\TestDeployment\target\repo\org\springframework\spring-context\4.2.5.RELEAS
E\spring-context-4.2.5.RELEASE.jar
[INFO] Installing artifact C:\Users\e049447\.m2\repository\org\springframework\s
pring-core\4.2.5.RELEASE\spring-core-4.2.5.RELEASE.jar to C:\STS\wsRestTemplate\
TestDeployment\target\repo\org\springframework\spring-core\4.2.5.RELEASE\spring-
core-4.2.5.RELEASE.jar
[INFO] Installing artifact C:\Users\e049447\.m2\repository\commons-logging\commo
ns-logging\1.2\commons-logging-1.2.jar to C:\STS\wsRestTemplate\TestDeployment\t
arget\repo\commons-logging\commons-logging\1.2\commons-logging-1.2.jar
[INFO] Installing artifact C:\Users\e049447\.m2\repository\org\hibernate\hiberna
te-validator-annotation-processor\5.2.4.Final\hibernate-validator-annotation-pro
cessor-5.2.4.Final.jar to C:\STS\wsRestTemplate\TestDeployment\target\repo\org\h
ibernate\hibernate-validator-annotation-processor\5.2.4.Final\hibernate-validato
r-annotation-processor-5.2.4.Final.jar
[INFO] Installing artifact C:\Users\e049447\.m2\repository\org\springframework\s
pring-webmvc\4.2.5.RELEASE\spring-webmvc-4.2.5.RELEASE.jar to C:\STS\wsRestTempl
ate\TestDeployment\target\repo\org\springframework\spring-webmvc\4.2.5.RELEASE\s
pring-webmvc-4.2.5.RELEASE.jar
[INFO] Installing artifact C:\Users\e049447\.m2\repository\org\springframework\s
pring-expression\4.2.5.RELEASE\spring-expression-4.2.5.RELEASE.jar to C:\STS\wsR
estTemplate\TestDeployment\target\repo\org\springframework\spring-expression\4.2
.5.RELEASE\spring-expression-4.2.5.RELEASE.jar
[INFO] Installing artifact C:\Users\e049447\.m2\repository\org\apache\tomcat\emb
ed\tomcat-embed-core\8.0.32\tomcat-embed-core-8.0.32.jar to C:\STS\wsRestTemplat
e\TestDeployment\target\repo\org\apache\tomcat\embed\tomcat-embed-core\8.0.32\to
mcat-embed-core-8.0.32.jar
[INFO] Installing artifact C:\Users\e049447\.m2\repository\org\apache\tomcat\emb
ed\tomcat-embed-logging-juli\8.0.32\tomcat-embed-logging-juli-8.0.32.jar to C:\S
TS\wsRestTemplate\TestDeployment\target\repo\org\apache\tomcat\embed\tomcat-embe
d-logging-juli\8.0.32\tomcat-embed-logging-juli-8.0.32.jar
[INFO] Installing artifact C:\Users\e049447\.m2\repository\org\apache\tomcat\emb
ed\tomcat-embed-jasper\8.0.32\tomcat-embed-jasper-8.0.32.jar to C:\STS\wsRestTem
plate\TestDeployment\target\repo\org\apache\tomcat\embed\tomcat-embed-jasper\8.0
.32\tomcat-embed-jasper-8.0.32.jar
[INFO] Installing artifact C:\Users\e049447\.m2\repository\org\apache\tomcat\emb
ed\tomcat-embed-el\8.0.32\tomcat-embed-el-8.0.32.jar to C:\STS\wsRestTemplate\Te
stDeployment\target\repo\org\apache\tomcat\embed\tomcat-embed-el\8.0.32\tomcat-e
mbed-el-8.0.32.jar
[INFO] Installing artifact C:\Users\e049447\.m2\repository\org\eclipse\jdt\core\
compiler\ecj\4.4.2\ecj-4.4.2.jar to C:\STS\wsRestTemplate\TestDeployment\target\
repo\org\eclipse\jdt\core\compiler\ecj\4.4.2\ecj-4.4.2.jar
[INFO] Installing artifact C:\Users\e049447\.m2\repository\org\apache\tomcat\tom
cat-jasper\8.0.32\tomcat-jasper-8.0.32.jar to C:\STS\wsRestTemplate\TestDeployme
nt\target\repo\org\apache\tomcat\tomcat-jasper\8.0.32\tomcat-jasper-8.0.32.jar
[INFO] Installing artifact C:\Users\e049447\.m2\repository\org\apache\tomcat\tom
cat-servlet-api\8.0.32\tomcat-servlet-api-8.0.32.jar to C:\STS\wsRestTemplate\Te
stDeployment\target\repo\org\apache\tomcat\tomcat-servlet-api\8.0.32\tomcat-serv
let-api-8.0.32.jar
[INFO] Installing artifact C:\Users\e049447\.m2\repository\org\apache\tomcat\tom
cat-juli\8.0.32\tomcat-juli-8.0.32.jar to C:\STS\wsRestTemplate\TestDeployment\t
arget\repo\org\apache\tomcat\tomcat-juli\8.0.32\tomcat-juli-8.0.32.jar
[INFO] Installing artifact C:\Users\e049447\.m2\repository\org\apache\tomcat\tom
cat-el-api\8.0.32\tomcat-el-api-8.0.32.jar to C:\STS\wsRestTemplate\TestDeployme
nt\target\repo\org\apache\tomcat\tomcat-el-api\8.0.32\tomcat-el-api-8.0.32.jar
[INFO] Installing artifact C:\Users\e049447\.m2\repository\org\apache\tomcat\tom
cat-api\8.0.32\tomcat-api-8.0.32.jar to C:\STS\wsRestTemplate\TestDeployment\tar
get\repo\org\apache\tomcat\tomcat-api\8.0.32\tomcat-api-8.0.32.jar
[INFO] Installing artifact C:\Users\e049447\.m2\repository\org\apache\tomcat\tom
cat-util-scan\8.0.32\tomcat-util-scan-8.0.32.jar to C:\STS\wsRestTemplate\TestDe
ployment\target\repo\org\apache\tomcat\tomcat-util-scan\8.0.32\tomcat-util-scan-
8.0.32.jar
[INFO] Installing artifact C:\Users\e049447\.m2\repository\org\apache\tomcat\tom
cat-util\8.0.32\tomcat-util-8.0.32.jar to C:\STS\wsRestTemplate\TestDeployment\t
arget\repo\org\apache\tomcat\tomcat-util\8.0.32\tomcat-util-8.0.32.jar
[INFO] Installing artifact C:\Users\e049447\.m2\repository\org\apache\tomcat\tom
cat-jasper-el\8.0.32\tomcat-jasper-el-8.0.32.jar to C:\STS\wsRestTemplate\TestDe
ployment\target\repo\org\apache\tomcat\tomcat-jasper-el\8.0.32\tomcat-jasper-el-
8.0.32.jar
[INFO] Installing artifact C:\Users\e049447\.m2\repository\org\apache\tomcat\tom
cat-jsp-api\8.0.32\tomcat-jsp-api-8.0.32.jar to C:\STS\wsRestTemplate\TestDeploy
ment\target\repo\org\apache\tomcat\tomcat-jsp-api\8.0.32\tomcat-jsp-api-8.0.32.j
ar
[INFO] Installing artifact C:\Users\e049447\.m2\repository\commons-fileupload\co
mmons-fileupload\1.3.1\commons-fileupload-1.3.1.jar to C:\STS\wsRestTemplate\Tes
tDeployment\target\repo\commons-fileupload\commons-fileupload\1.3.1\commons-file
upload-1.3.1.jar
[INFO] Installing artifact C:\Users\e049447\.m2\repository\commons-io\commons-io
\2.2\commons-io-2.2.jar to C:\STS\wsRestTemplate\TestDeployment\target\repo\comm
ons-io\commons-io\2.2\commons-io-2.2.jar
[INFO] Installing artifact C:\Users\e049447\.m2\repository\javax\servlet\javax.s
ervlet-api\3.0.1\javax.servlet-api-3.0.1.jar to C:\STS\wsRestTemplate\TestDeploy
ment\target\repo\javax\servlet\javax.servlet-api\3.0.1\javax.servlet-api-3.0.1.j
ar
[INFO] Installing artifact C:\STS\wsRestTemplate\TestDeployment\target\embeddedA
pp.jar to C:\STS\wsRestTemplate\TestDeployment\target\repo\com\mycompany\myapp\b
atchs\AuthFileUpload\0.0.1-SNAPSHOT\AuthFileUpload-0.0.1-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19.899 s
[INFO] Finished at: 2016-03-07T13:50:14-06:00
[INFO] Final Memory: 22M/123M
[INFO] ------------------------------------------------------------------------

C:\STS\wsRestTemplate\TestDeployment>cd target

C:\STS\wsRestTemplate\TestDeployment\target>java -jar embeddedApp.jar
Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/catalina/L
ifecycleException
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
        at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
        at java.lang.Class.getMethod0(Class.java:3018)
        at java.lang.Class.getMethod(Class.java:1784)
        at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544
)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)

Caused by: java.lang.ClassNotFoundException: org.apache.catalina.LifecycleExcept
ion
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 7 more

C:\STS\wsRestTemplate\TestDeployment\target>

在pom中添加了额外的插件

Extra plugin added in pom

<finalName>embeddedApp</finalName>
              <plugins>
                     <plugin>
                           <groupId>org.apache.maven.plugins</groupId>
                           <artifactId>maven-compiler-plugin</artifactId>
                           <version>${maven.compiler.plugin.version}</version>
                           <configuration>
                                  <source>${java.version}</source>
                                  <target>${java.version}</target>
                           </configuration>
                     </plugin>


                     <plugin>
                           <groupId>org.codehaus.mojo</groupId>
                           <artifactId>appassembler-maven-plugin</artifactId>
                           <version>1.10</version>
                           <configuration>
                                  <assembleDirectory>target</assembleDirectory>
                                  <programs>
                                         <program>
                                                <mainClass>com.mycompany.myapp.batchs.TestDeployment.App</mainClass>
                                                <name>App</name>
                                         </program>
                                  </programs>
                           </configuration>
                           <executions>
                                  <execution>
                                         <phase>package</phase>
                                         <goals>
                                                <goal>assemble</goal>
                                         </goals>
                                  </execution>
                           </executions>
                     </plugin>

                     <plugin>
                           <!-- Build an executable JAR -->
                           <groupId>org.apache.maven.plugins</groupId>
                           <artifactId>maven-jar-plugin</artifactId>
                           <version>2.6</version>
                           <configuration>
                                  <archive>
                                         <manifest>
                                                <addClasspath>true</addClasspath>
                                                <classpathPrefix>lib/</classpathPrefix>
                                                <mainClass>com.mycompany.myapp.batchs.TestDeployment.App</mainClass>
                                         </manifest>
                                  </archive>
                           </configuration>
                     </plugin>

              </plugins>

推荐答案

您的应用程序结构错误.Maven jar 项目没有 src/main/webapp 文件夹.

Your app structure is wrong. Maven jar projects do not have a src/main/webapp folder.

另一方面,为了让容器(而不是类加载器)在 jar 中找到应用程序的 Web 资源(index.jsp),您必须在 web.xml 中声明它是一个 servlet 3.0 webapp 并将资源放在 src/main/resources/META-INF/resources 中.请参阅此处了解更多详情.

On the other hand, in order to the container (not the classloader) finding the web resources (index.jsp) of your application in a jar, you must declare in web.xml that it is a servlet 3.0 webapp and place the resources in src/main/resources/META-INF/resources. See here for more details.

试试这个:

  1. 确保 webapp 是 servlet 3.0 并且 index.jsp 是一个欢迎文件

  1. Ensure webapp is servlet 3.0 and index.jsp is a welcome-file

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    ...
</web-app>

  • 将结构重构为:

  • Refactor the structure to:

    |-- src/main/resources
    |   |-- WEB-INF/App-servlet.xml
    |   |-- META-INF/resources
    |   |   | --  WEB-INF/web.xml
    |   |   | --  index.jsp
    

  • 这篇关于嵌入式 Tomcat + Spring 文件上传:HTTP 404的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆