首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏卯金刀GG

    【java基础】压缩图片上传

    log.info("*******************进入图片上传的方法*************************"); ServletContext servletContext = WebContext.getServletContext FileOutputStream fs = null; DataState dataState = new DataState(); HttpServletRequest request = WebContext.getServletRequest (); UserEntity user = WebContext.getUserEntity(); Iterator<String> itr = requestFile.getFileNames Common.getValue("RETURN_URL", "com.ztb.common.util.properties.ftp") + time + "/" + totrueFileName; WebContext.getSession

    2.2K30发布于 2019-07-25
  • 来自专栏IT当时语_青山师_JAVA技术栈

    Java集成thymeleaf视图层模板引擎构建web项目实例讲解(附项目源码)

    模板引擎表达式可以从properties文件和WebContext获取属性值从而展示到页面。需要注意的是:属性文件、模板文件必须同名且位于同一目录(编译后)。 {…}: OGNL表达式 会获取在org.thymeleaf.context.WebContext中设置的值。 在这个Demo中表达式{currentDate} 将会获取在WebContext中设置的currentDate 属性值。 process(HttpServletRequest request, HttpServletResponse response) throws IOException { WebContext ctx = new WebContext(request, response, request.getServletContext(), request.getLocale

    1.2K10编辑于 2023-05-04
  • 来自专栏做全栈攻城狮

    SpringBoot 2.0中SpringWebContext 找不到无法使用的问题解决

    image 然后看到WebContext似乎有些像上面所用的SpringWebContext。即做出如下改变,完美实现了thymeleaf的页面渲染。 WebContext ctx = new WebContext(request, response, request.getServletContext(), request.getLocale(),

    1.3K30发布于 2018-12-20
  • 来自专栏一个爱瞎折腾的程序猿

    asp.net core后台系统登录的快速构建

    HttpContext.Response.Cookies.Delete(ApplicationKeys.User_Cookie_Key); return Redirect(WebContext.LoginUrl OnAuthorization(AuthorizationFilterContext filterContext) { if (string.IsNullOrEmpty(WebContext.AdminName "Account/Login"); } return; } } } 上面特性标记代码中的WebContext.AdminName return Instance.GetService<T>(); } } //一些通用的信息 public static class WebContext ServiceLocator.Instance,这样就能够在任何地方使用ServiceLocator.Instance获取到注入的服务 (为了更好的获取实例添加了一个T GetService<T>()方法) 在WebContext

    3.9K10发布于 2018-09-14
  • 来自专栏wayn的程序开发

    Spring Boot3.0升级,踩坑之旅,附解决方案

    header-fragment}"/>2.2 Thymeleaf升级到3.1.0.M2,后端使用 thymeleafViewResolver 手动渲染网页代码报错// 修改前 Spring Boot2.7:WebContext model.asMap());html = thymeleafViewResolver.getTemplateEngine().process("mall/seckill-list", ctx);上述代码中针对 WebContext jakartaServletWebApplication = JakartaServletWebApplication.buildApplication(request.getServletContext());WebContext ctx = new WebContext(jakartaServletWebApplication.buildExchange(request, response), request.getLocale

    3.4K121编辑于 2022-12-04
  • 来自专栏sowhat1412

    手写个Tomcat雏型

    对解析结果优化映射服务:WebContext package com.sowhat.server.core; import java.util.HashMap; import java.util.List * * 功能: 解析XML结果 HTTP网页请求跟 对应Java代码中哪个类来处理 * 目的: 对XML解析后,以后输入一个请求的网址 就可以返回对应的处理类 */ public class WebContext 跟 WebHandler * */ public class WebApp { private static WebContext webContext; static { ().getContextClassLoader().getResourceAsStream("web.xml"), handler); //获取数据 webContext = new WebContext(handler.getEntitys(), handler.getMappings()); } catch (Exception e) {

    56010发布于 2020-11-05
  • 来自专栏云计算linux

    Thymeleaf入门

    ViewBaseServlet类 package cn.yanqi.web; import org.thymeleaf.TemplateEngine; import org.thymeleaf.context.WebContext // 1.设置响应体内容类型和字符集 resp.setContentType("text/html;charset=UTF-8"); // 2.创建WebContext 对象 WebContext webContext = new WebContext(req,resp,getServletContext()); // 3.处理模板数据 templateEngine.process(templateName, webContext, resp.getWriter()); } } ViewBaseServlet类的

    31200编辑于 2024-12-13
  • 来自专栏JAVA人生/面试技巧

    DWR服务器推送技术

    org.directwebremoting.ScriptBuffer; import org.directwebremoting.ScriptSession; import org.directwebremoting.WebContext class DwrPush { @SuppressWarnings("deprecation") public static void Send(String msg){ WebContext webContext = WebContextFactory.get(); @SuppressWarnings("deprecation") Collection<ScriptSession > sessions = webContext.getAllScriptSessions(); // 构建发送所需的JS脚本 ScriptBuffer scriptBuffer

    2K20发布于 2019-10-15
  • 来自专栏个人技术博客

    【Web实战-Tomcat-Servlet-Thymeleaf -JDBC-MySQL】浏览器页面显示数据库数据(水果库存系统)

    Thymeleaf 技术相关的属性以及方法,我们可以通过代码来了解其功能: import org.thymeleaf.TemplateEngine; import org.thymeleaf.context.WebContext // 1.设置响应体内容类型和字符集 resp.setContentType("text/html;charset=UTF-8"); // 2.创建WebContext 对象 WebContext webContext = new WebContext(req, resp, getServletContext()); // 3.处理模板数据 templateEngine.process(templateName, webContext, resp.getWriter()); } } ---- 3.添加web.xml

    1.7K30编辑于 2022-11-15
  • 来自专栏依乐祝

    重学ASP.NET Core 中的标记帮助程序

    @using AuthoringTagHelpers.Models @{ ViewData["Title"] = "About"; WebsiteContext webContext = </bold>

    web site info

    <website-information info="<em>webContext</em>" /> 说明: 在下面的Razor显示的标记中: < website-information info="<em>webContext</em>" /> Razor知道 info 属性是一个类,而不是字符串,并且您想要编写 c # 代码。 

    4.1K10发布于 2020-06-28
  • 来自专栏全栈程序员必看

    服务器重启项目引发的nginx 502 Bad Gateway解决

    继续搜资料:借鉴一下人家的分析: `tomcat启动,初始化webcontext; `初始化spring, spring初始某些些bean,这些bean包括了zookeeper的连接相关的bean; zkClient(独立线程)已经连接上服务器了,但是classloader没有加载到org/apache/zookeeper/proto/SetWatches类; `spring初始化失败,导致Tomcat webcontext

    2.6K30编辑于 2022-09-12
  • 来自专栏卯金刀GG

    Angular2使用ng2-file-upload上传文件

    , IOException { DataState dataState = new DataState(); HttpServletRequest request = WebContext.getServletRequest (); UserEntity user = WebContext.getUserEntity(); Iterator<String> itr = requestFile.getFileNames System.out.println("存放图片文件的路径:" + filePath); // 转存文件到指定的路径 file.transferTo(new File(path)); WebContext.getSession

    2.1K50发布于 2019-07-25
  • 来自专栏瓜农老梁

    Nacos1# 服务注册与发现客户端示例与源码解析(一)

    :/nacos nacosUrlBase:webContext + "/v1/ns",默认 /nacos/v1/ns nacosUrlInstance:nacosUrlBase + "/instance /v1/ns/instance public static void initWebRootContext(Properties properties) { final String webContext properties.getProperty(PropertyKeyConst.CONTEXT_PATH); TemplateUtils.stringNotEmptyAndThenExecute(webContext new Runnable() { @Override public void run() { UtilAndComs.webContext = ContextPathUtil.normalizeContextPath(webContext); UtilAndComs.nacosUrlBase = UtilAndComs.webContext

    2.3K31发布于 2021-06-10
  • 来自专栏开源单点登录集成

    基于Maxkey Oauth2接入Grafana,实现单点登录

    successfulRedirect = successfulRedirect + "&state="+state; HttpServletRequest request = WebContext.getRequest (); String serverName = request.getServerName();WebContext.setCookie(WebContext.getResponse

    1.4K10编辑于 2024-05-10
  • 来自专栏ImportSource

    1.7分钟学会Spring Boot的CommandLineRunner

    有趣的是,上面的 ApplicationLoader类是在NixMash Spring JPA RootContext模块中,但是MVC WebContext模块中的 @SpringBootApplication

    2K60发布于 2018-04-03
  • 来自专栏程序源代码

    免费网盘系统,想放啥就放啥

    model 服务器行为控制类:KiftdCtl 服务器界面相关包:printer 相关包:file_system_manager 第三方工具使用许可证包:licenses web页面静态资源文件夹:/webContext

    1.8K50发布于 2019-10-25
  • 来自专栏一枝花算不算浪漫的专栏

    [Java Collection]List分组之简单应用.

    最后看看我们是如何高效率的通过传入的seriesIds取值的: public List<HashMap<Long, List<SeriesValueRateDTO>>> listSeriesValueRates() { WebContext context = WebContext.get(); List<Long> ids =context.getRequiredLongList("seriesIds"); List<HashMap

    1.3K50发布于 2018-05-18
  • 来自专栏卯金刀GG

    springmvc【问题1】跨域

    javax.servlet.http.HttpServletResponse; import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; import com.ztb.context.WebContext Content-Type"); response.addHeader("Access-Control-Allow-Credentials", "true"); (1) WebContext.getServletResponse

    1.2K20发布于 2019-07-26
  • 来自专栏响应式编程

    Spring提供的对数据(库)访问的几个套路

    因为对DAO这个层面进行测试完全没必要引入类似WebContext这样耗能的上下文环境,如下所示即可。

    1.2K10编辑于 2022-05-30
  • 来自专栏凯哥Java

    JavaWeb学习-Ajax-1-Ajax简介

    4.1 XMLHttpReuqest的构造方法 Eclipse上新建一个动态的web项目,然后在WebContext文件夹下新建一个1.html文件,输入下面代码。

    66830发布于 2019-07-11
领券