小编ASU*_*SUR的帖子

删除CSS文件

我正在使用带有jsp页面的spring MVC进行演示,我在一个jsp页面中有三个选项卡,假设A,B和C. 在单击A选项卡时,css文件(如aa.css)已加载到head标签中,并显示相应的div,并且单击B和C时的方式相同.主要问题是三次.正在加载CSS文件,它会相互覆盖.此外,我想从头部删除css文件,使用jquery点击任何上面的选项卡,如下所示.

  $("#A").click(function(){
     alert("Remove bb and cc.css file form head tag");
  });
Run Code Online (Sandbox Code Playgroud)

任何想法都会对我有所帮助.

谢谢.

css jquery jsp spring-mvc

9
推荐指数
2
解决办法
2万
查看次数

以编程方式使用apache和spring创建子域

我正在使用Spring,jsp和Apache 7.0服务器开发应用程序,现在假设我有注册域名,例如"www.example.com",并且在我的应用程序中,用户填写用户要求输入他的URL的注册表单在填写详细信息之后提交表单时,请立即命名为"123"我希望将他重定向到我们的案例"123.example.com"中新创建的URL

现在在这个运动中,我必须在重定向之前在我的代码中创建子域.我已经通过谷歌找不到多少.

任何帮助

提前致谢.

java jsp spring-mvc

7
推荐指数
1
解决办法
2305
查看次数

使用spring mvc 3将一个控制器重定向到另一个控制器

下面是我的控制器

  @RequestMapping(method = RequestMethod.GET)
@ResponseBody
public String ABC(Registratio registration, ModelMap modelMap,
        HttpServletRequest request,HttpServletResponse response){
        if(somecondition=="false"){
           return "notok";  // here iam returning only the string 
          }
          else{
               // here i want to redirect to another controller shown below
           }
}

 @RequestMapping(value="/checkPage",method = RequestMethod.GET,)
public String XYZ(ModelMap modelMap,
        HttpServletRequest request,HttpServletResponse response){
       return "check";   // this will return check.jsp page
}
Run Code Online (Sandbox Code Playgroud)

由于控制器ABC是@ResponceBody类型,它将始终作为字符串返回,但我希望在其他情况下它应该被重定向到XYZ控制器,并从中返回一个我可以显示的jsp页面.我尝试使用return"forward:checkPage"; 还有 返回"redirect:checkPage"; 但不起作用.任何帮助.

谢谢.

java spring-mvc

7
推荐指数
1
解决办法
4万
查看次数

在JSP中使用EL时出错:"当未指定默认命名空间时,函数contains必须与前缀一起使用"

在我的jsp页面中,我指定:

<c:choose>
line 1: <c:when test="${com.community_classification_id.contains('1')}">
            <input type="checkbox" id="by_invitation1"   name="invitaion" value="1" checked="true">By Invitation<span style="padding-left:28px"></span>
        </c:when>
        <c:otherwise>
            <input type="checkbox" id="by_invitation1"   name="invitaion" value="1">By Invitation<span style="padding-left:28px"></span>
        </c:otherwise>
</c:choose>
Run Code Online (Sandbox Code Playgroud)

但@line没有.1它给我500错误

The function contains must be used with a prefix when a default namespace is not specified
Run Code Online (Sandbox Code Playgroud)

我无法理解它.怎么了?

jsp jstl el

4
推荐指数
1
解决办法
1万
查看次数

如何配置MultipartResolver?

<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:beans="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">

<!-- Enables the Spring MVC @Controller programming model -->
<annotation-driven />

<!-- Handles HTTP GET requests for /resources/** by efficiently serving 
    up static resources in the ${webappRoot}/resources/ directory -->
<resources mapping="/resources/**" location="/resources/" />
 <bean class="org.springframework.web.multipart.commons.CommonsMultipartResolver" 
    id="multipartResolver"> <property name="maxUploadSize" value="500000" /> 
</bean>
Run Code Online (Sandbox Code Playgroud)

有我的context.xml文件但是当我包含multipartResolver配置时,我收到以下错误:

"cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'bean'.".
Run Code Online (Sandbox Code Playgroud)

请帮助我,我是春天新手.

spring-mvc

2
推荐指数
1
解决办法
7855
查看次数

标签 统计

spring-mvc ×4

jsp ×3

java ×2

css ×1

el ×1

jquery ×1

jstl ×1