RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / user-288922

Egor Vasilyev's questions

Martin Hope
Egor Vasilyev
Asked: 2020-06-24 17:13:23 +0000 UTC

maven不在生成的war文件中包含库jar

  • 1

使用 Eclipse,我有一个maven具有一些依赖项的项目。现在我需要准备项目的变体之一,其中除其他更改外,在创建war文件时不要在其中包含库。

简而言之,请参阅下文了解更多详细信息:

目前,该项目有一个enum,其中列出了构建类型(DEBUG_MODE,PRODUCTION_MODE,SINGLE_VERSION)DEBUG_MODE,并且PRODUCTION_MODE编译后的.war文件必须包含所有连接的库(它们已部署到生产服务器)。

SINGLE_VERSION部署在本地机器上。连接可能很差,因此上传文件的大小至关重要。作为一个选项:将项目中使用的所有库下载到本地计算机并指定 inpom.xml以便它在本地目录中搜索它们。

是否可以根据构建参数指定maven'у在哪里查找使用的库,如果可以,从哪里获取信息?

我找到了解释如何不在war. 我还找到了说明如何将本地目录指定maven为查找库的源的信息。但是如何通过更改一个参数使其包含/不包含在休息日中war,从而使这一时刻成为可选的?此外,您如何告诉项目在哪里查找该库:在本地目录中,还是在存档本身中?

java
  • 1 个回答
  • 10 Views
Martin Hope
Egor Vasilyev
Asked: 2020-01-15 13:57:08 +0000 UTC

vaadin 8 面包店应用程序登录

  • 0

我正在使用 vaadin 8 + tomcat 7。vaadin 网站有一个面包店演示应用程序。

具体来说,我对日志记录过程很感兴趣。有一个单独的 LoginHtmlServlet servlet,它以某种方式与 vaadin 应用程序本身一起工作,这是它的代码:

@WebServlet(asyncSupported = true, urlPatterns = LoginHtmlServlet.LOGIN_HTML)
public class LoginHtmlServlet extends HttpServlet implements HasLogger {

    public static final String LOGIN_HTML = "/login.html";

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        serveLoginHtml(req, resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        if (req.getAttribute("shiroLoginFailure") != null) {
            try {
                resp.sendRedirect(LOGIN_HTML + "?error");
                return;
            } catch (Exception e) {
                getLogger().error("Failed to redirect to login error page", e);
            }
        }
        serveLoginHtml(req, resp);
    }

    private void serveLoginHtml(HttpServletRequest request, HttpServletResponse response) throws IOException {
        InputStream loginHtml = request.getServletContext().getResourceAsStream(LOGIN_HTML);
        response.setCharacterEncoding("utf-8");
        org.apache.commons.io.IOUtils.copy(loginHtml, response.getOutputStream());

    }
}

还有一个 LoginHtmlServlet 引用的 login.html 页面:

<!DOCTYPE html>
<html>
<!-- 
Hint to Vaadin that if this page is ever sent back as response to a UIDL request, the user should be redirected.

Vaadin-Refresh: context://login.html
-->
<head>
  <title>My Starter Project</title>
  <meta charset="utf-8">
  <link rel="shortcut icon" href="VAADIN/themes/apptheme/favicon.ico" />
  <link rel="import" href="bower_components/vaadin-valo-theme/color.html"> 
  <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
  
  <!-- Enable these to hide browser controls when app is started from homescreen:
  <meta name="mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-capable" content="yes">
  -->
    
  <script type="text/javascript">
    var init = function() {
      if (window.location.search.indexOf("error")>0) {
          document.body.className = "error";
      }
    }
    
  </script>
	<style>
		@font-face {
			font-family: "Open Sans";
			src: url(VAADIN/themes/valo/fonts/open-sans/OpenSans-Light-webfont.woff) format("woff");
			font-weight: 300;
			font-style: normal;
		}
		@font-face {
			font-family: "Open Sans";
			src: url(VAADIN/themes/valo/fonts/open-sans/OpenSans-Semibold-webfont.woff) format("woff");
			font-weight: 600;
			font-style: normal;
		}
		
    html {
     background: linear-gradient(145deg, #0755ba 30%, #e7f1fe 100%);
    }
    @media (min-width: 1000px) {
      /* load on wide screens */
      body {
        background-color: transparent;
        background-size: cover;
      }
    }
    button {
      background-color: #1676f4;
    }
    #logo {
      display: inline-block;
      width: 60px;
      height: 60px;
      border-radius: 100%;
      background-size: contain;
      background-repeat: no-repeat;
      background-color: rgba(255,255,255,0.2);
      box-shadow: 3px 3px 8px rgba(0,0,0,.2);
    }

		/* Layout */
		*, *:before, *:after {
      box-sizing: border-box;
    }
		html, body {
			height: 100%;
			font: 100 16px/1.55 "Open Sans", sans-serif;
			margin: 0;
		}
		#info {
       color: #fff;
       text-align: center;
       padding: 28px;
		}
		#form {
			height: 100%;
			display: flex;
			background-color: #fff;
			justify-content: center;
    }
    
    /* Responsive behaviour */	
		@media (max-width: 1000px) {
		  h2 {
        display: none;
      }
		}
		
		@media (min-width: 1001px) {
	    body {
	      display: flex;
	      align-items: center;
	      justify-content: center;
	    }
	    #logo {
	      width:96px;
        height:96px;
	    }
	    #info, #form {
	      height: 450px;
	      box-shadow: 0 2px 3px rgba(0,0,0,.2);
	    }
	    #info {
        background-color: rgba(255,255,255,.2);
	      width: 465px;
	      border-radius: 5px 0 0 5px;
	    }
	    #form {
	      width: 320px;
	      padding: 28px;
	      border-radius: 0 5px 5px 0;
	    }
    }
		
		/* Elements / components theme */
		
		h1 {
			font-size: 36px;
			font-weight: 100;
		}	
		h2 {
			font-size: 28px;
			font-weight: 100;
			margin-bottom: 14px;
		}	
		form {
			max-width: 320px;
		}
		label {
			font-size: 14px;
			padding: 16px 0 5px 0;
			display: inline-block; 
		}	
		input[type='text'],
		input[type='password'] {
			width: 100%;
			
			-webkit-appearance: none;
			-moz-appearance: none;
			-ms-appearance: none;
			-o-appearance: none;
			appearance: none;
			
			font: inherit;
			font-size: 14px;
			
			height: 37px;
			border-radius: 4px;
			padding: 4px 9px;
			border: 1px solid rgba(0,0,0,.2);
		}
		button {
			width:100%;
			margin-top: 37px;
			height: 37px;
			border: 1px solid #666;
			border-radius: 4px;
			background-image: linear-gradient(to bottom,rgba(255,255,255,0.2) 2%, rgba(0,0,0,0.1) 98%);
			box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 -1px 0 rgba(0, 0, 0, 0.2), 0 2px 3px rgba(0, 0, 0, 0.05);
			outline: none;
			cursor: pointer;
			color: #fff;
			text-align: center;
			position: relative;
			font: inherit;
			font-weight: 600;
		}
		#button-submit:focus:after {
			box-shadow: 0 0 0 2px rgba(0,0,0,.5);
			content: "";
			position: absolute;
			top: -2px;
			right: -2px;
			bottom: -2px;
			left: -2px;
			border-radius: inherit;
		}
		.error input {
			display: block;
			border-color: red;
		}
		.error form:after {
			content: "The username and password you entered do not match our records. Please double-check and try again.";
			display: block;
			border: 1px solid red;
			border-radius: 4px;
			width: 100%;
			margin-top: 16px;
			font-size: 14px;
			padding: 8px;
		}
	</style>
</head>
<body onload="init()">
	<div id="form">
		<form method="post" action="" id="theform">
			<h2>Страница входа</h2>
			<label id="login-label" for="login">Логин</label>
			<input type="text" id="login" name="username" aria-labelledby="login-label" autofocus>
			<label id="password-label" for="password">Пароль</label>
			<input type="password" id="password" name="password" aria-labelledby="password-label">
			<button id="button-submit" type="submit">Войти</button>
		</form>
	</div>
</body>
</html>

我特别感兴趣的是什么。Vaadin 版本 8 有一个 LoginForm,据推测,浏览器可以使用它来确定和保存登录/密码字段。它实际上只适用于 Firefox,这不适合我。使用面包店应用程序中提供的这种方法,保存登录名/密码没有问题。但是,在快速运行了整个演示项目之后,我并没有发现 LoginHtmlServlet 的使用位置和方式。我也没有找到任何信息。所以,一个具体的问题:您如何准确地同时使用 servlet 和 vaadin 项目,如何使用来自 vaadin 项目的附加 servlet。

一般来说,如何实现与演示项目中相同的登录?

java-ee
  • 1 个回答
  • 10 Views
Martin Hope
Egor Vasilyev
Asked: 2020-04-06 12:23:11 +0000 UTC

如何从您的对象中通过 ArrayList 传递 Parcelable

  • 1

我的班级有一个 ArrayList。我试图通过 Parcelable 传递它,但出现错误。下面是类的结构和代码本身。如何传递这样的数据类型?

班级本身

class Lists{
        String name_opt;
        byte[] value;
    }

    class ConfigStruct{
        String page;
        String name;
        String type;
        byte[] val_size;
        byte[] max_lenght;
        byte[] min_lenght;
        byte[] value;
        List<Lists> list;
        View view;
    }

转移尝试

public class ConfigStructParcelable implements Parcelable {

    List<Tabs.ConfigStruct> structs;

    public ConfigStructParcelable(ArrayList<Tabs.ConfigStruct> data){
        this.structs = data;
    }
    public ConfigStructParcelable(Parcel in){

        this.structs = in.readArrayList(null);//?
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeList(structs); //?
    }

    public static Creator<ConfigStructParcelable> CREATOR = new Creator<ConfigStructParcelable>() {
        @Override
        public ConfigStructParcelable createFromParcel(Parcel source) {
            return new ConfigStructParcelable(source);
        }

        @Override
        public ConfigStructParcelable[] newArray(int size) {
            return new ConfigStructParcelable[size];
        }
    };

}

我用“//?”标记 需要帮助的地方。链接帖子没有帮助。

https://stackoverflow.com/questions/7042272/how-to-properly-implement-parcelable-with-an-arraylistparcelable/7042757

android
  • 1 个回答
  • 10 Views
Martin Hope
Egor Vasilyev
Asked: 2020-03-28 14:50:42 +0000 UTC

以编程方式创建具有特定线性布局的片段

  • 0

下午好!

我的程序读取消息,并根据其内容创建几个具有不同填充的 LinearLayout。

是否可以使用生成的 LinearLayouts 之一以编程方式创建片段(片段数 = 布局数,最终数字事先不知道)

android
  • 1 个回答
  • 10 Views
Martin Hope
Egor Vasilyev
Asked: 2020-03-15 02:17:13 +0000 UTC

用 EditText 编写的动态检查

  • 1

问题是:真的有可能以某种方式在 Android 的 EditText 中跟踪动态写入的数据吗?例如,我有一个数字的最大值和最小值的数据,有必要检查用户输入的值是否不超出指定的边界(在打字过程中或通过切换到下一个布局元素) 并且,如果数字不包括在边界中,则替换输入的数字。我在网上搜索了,但我只遇到了按下按钮时检查的例子,这不合适,因为。许多选项卡和许多 EditTexts。为了给安卓编程,我几乎坐了下来,所以不要用你的拖鞋猛烈撞击)提前感谢你的帮助!

android
  • 2 个回答
  • 10 Views

Sidebar

Stats

  • 问题 10021
  • Answers 30001
  • 最佳答案 8000
  • 用户 6900
  • 常问
  • 回答
  • Marko Smith

    我看不懂措辞

    • 1 个回答
  • Marko Smith

    请求的模块“del”不提供名为“default”的导出

    • 3 个回答
  • Marko Smith

    "!+tab" 在 HTML 的 vs 代码中不起作用

    • 5 个回答
  • Marko Smith

    我正在尝试解决“猜词”的问题。Python

    • 2 个回答
  • Marko Smith

    可以使用哪些命令将当前指针移动到指定的提交而不更改工作目录中的文件?

    • 1 个回答
  • Marko Smith

    Python解析野莓

    • 1 个回答
  • Marko Smith

    问题:“警告:检查最新版本的 pip 时出错。”

    • 2 个回答
  • Marko Smith

    帮助编写一个用值填充变量的循环。解决这个问题

    • 2 个回答
  • Marko Smith

    尽管依赖数组为空,但在渲染上调用了 2 次 useEffect

    • 2 个回答
  • Marko Smith

    数据不通过 Telegram.WebApp.sendData 发送

    • 1 个回答
  • Martin Hope
    Alexandr_TT 2020年新年大赛! 2020-12-20 18:20:21 +0000 UTC
  • Martin Hope
    Alexandr_TT 圣诞树动画 2020-12-23 00:38:08 +0000 UTC
  • Martin Hope
    Air 究竟是什么标识了网站访问者? 2020-11-03 15:49:20 +0000 UTC
  • Martin Hope
    Qwertiy 号码显示 9223372036854775807 2020-07-11 18:16:49 +0000 UTC
  • Martin Hope
    user216109 如何为黑客设下陷阱,或充分击退攻击? 2020-05-10 02:22:52 +0000 UTC
  • Martin Hope
    Qwertiy 并变成3个无穷大 2020-11-06 07:15:57 +0000 UTC
  • Martin Hope
    koks_rs 什么是样板代码? 2020-10-27 15:43:19 +0000 UTC
  • Martin Hope
    Sirop4ik 向 git 提交发布的正确方法是什么? 2020-10-05 00:02:00 +0000 UTC
  • Martin Hope
    faoxis 为什么在这么多示例中函数都称为 foo? 2020-08-15 04:42:49 +0000 UTC
  • Martin Hope
    Pavel Mayorov 如何从事件或回调函数中返回值?或者至少等他们完成。 2020-08-11 16:49:28 +0000 UTC

热门标签

javascript python java php c# c++ html android jquery mysql

Explore

  • 主页
  • 问题
    • 热门问题
    • 最新问题
  • 标签
  • 帮助

Footer

RError.com

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

帮助

© 2023 RError.com All Rights Reserve   沪ICP备12040472号-5