SpringMvc 整合Freemarker后,ftl页面怎么获取httpSession

SpringMvc 整合Freemarker后,ftl页面怎么获取httpSession,第1张

springmvc的配置文件中对freemarker配置如下:

<bean

id="viewResolver"

class="orgspringframeworkwebservletviewfreemarkerFreeMarkerViewResolver">

<property

name="viewClass"

value="orgspringframeworkwebservletviewfreemarkerFreeMarkerView"

/>

<property name="suffix" value="html" />

<property

name="contentType" value="text/html;charset=utf-8" />

<property

name="exposeRequestAttributes" value="true" />

<property

name="exposeSessionAttributes" value="true" />

<property

name="exposeSpringMacroHelpers" value="true" />

<!--

此变量值为pageContextrequest, 页面使用方法:rccontextPath -->

<property

name="requestContextAttribute" value="rc" />

</bean>

是这样方式:

${Session["user"]}

~如果你认可我的回答,请及时点击采纳为满意回答按钮

~~手机提问的朋友在客户端右上角评价点满意即可。

~你的采纳是我前进的动力

~~O(∩_∩)O,记得好评和采纳,互相帮助,谢谢。

1打开SpringMVC的文件上传功能:-servletxml中配置

2创建上传文件的filejsp

3Controller层创建代码

以上 *** 作步骤准确无误,本人JAVA学的很好。

@RequestMapping(value = "/login", method = RequestMethodGET)

public ModelAndView myMethod(>

以上就是关于SpringMvc 整合Freemarker后,ftl页面怎么获取httpSession全部的内容,包括:SpringMvc 整合Freemarker后,ftl页面怎么获取httpSession、java-SpringMVC 后台怎么获取前台jsp页面中file中的文件、aop怎么获取springmvc controller中的requestmapping等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/10622358.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-10
下一篇2023-05-10

发表评论

登录后才能评论

评论列表(0条)

    保存