我正在使用SimpleXML库.我需要获取rss feed并将其转换为java对象.这里我需要映射到对象的XML
<rss xmlns:lj="http://www.livejournal.org/rss/lj/1.0/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:atom10="http://www.w3.org/2005/Atom" version="2.0">
<channel>
<title>??????! ?????! ?? ?????! ? ?? ? ???!</title>
<link>http://xuma.livejournal.com/</link>
<description>
??????! ?????! ?? ?????! ? ?? ? ???! - LiveJournal.com
</description>
<lastBuildDate>Thu, 17 Mar 2011 10:08:33 GMT</lastBuildDate>
<generator>LiveJournal / LiveJournal.com</generator>
<lj:journal>xuma</lj:journal>
<lj:journalid>5295048</lj:journalid>
<lj:journaltype>personal</lj:journaltype>
<copyright>NOINDEX</copyright>
<image>
<url>http://l-userpic.livejournal.com/104864030/5295048</url>
<title>??????! ?????! ?? ?????! ? ?? ? ???!</title>
<link>http://xuma.livejournal.com/</link>
<width>66</width>
<height>100</height>
</image>
<item>
<guid isPermaLink="true">http://xuma.livejournal.com/7831.html</guid>
<pubDate>Thu, 17 Mar 2011 10:08:33 GMT</pubDate>
<title>??????. ??????? ????????????.</title>
<link>http://xuma.livejournal.com/7831.html</link>
<description>...</description>
<comments>http://xuma.livejournal.com/7831.html</comments>
<lj:security>public</lj:security>
<lj:reply-count>0</lj:reply-count>
</item>
<item>
<guid isPermaLink="true">http://xuma.livejournal.com/7575.html</guid>
<pubDate>Sat, 16 Oct …
Run Code Online (Sandbox Code Playgroud) 我们假设我已经定义了以下实体:
@Entity
class User{
@Id
@GeneratedValue
@Column(name = "DB_ID")
private long id;
@Id
@Column(name = "LOGIN", unique = true)
private String code;
//setters, getters
}
Run Code Online (Sandbox Code Playgroud)
问题#1.
当我使用该方法时.find(User.class, someId)
,我必须设置什么ID?我应该使用长字段ID还是字符串字段代码?或者我可以同时使用长字段ID和字符串字段代码吗?
问题2.
如果我想使用该方法.merge(user)
,在哪种情况下记录会更新?
情况#1: - id等于DB_ID,代码不等于LOGIN
情况#2: - id不等于DB_ID,代码等于LOGIN
情况#3: - idequals DB_ID和代码等于LOGIN
或任何其他条件?
周转的问题是轴附着在地质中.
现在:__ http://f2.s.qip.ru/cMfvUhEy.png
现在(旋转):http://f3.s.qip.ru/cMfvUhEC.png
必要(轮换):http://f1.s.qip.ru/cMfvUhEG.png
我有一个在网站上运行的 Nginx 服务器https://example.com
。我正在尝试通过反向代理在我拥有/管理员的另一台远程服务器上提供一个页面(来自 OctoPi),在http://1.2.3.4:1988
.
我可以在 上提供主页https://example.com/foo/
,但是 css 和 js 文件没有加载。控制台显示诸如此类的文件https://example.com/foo/static/webassets/packed_libs.css
给出了 404 错误。如果我访问,https://1.2.3.4:1988/foo/static/webassets/packed_libs.css
我可以读取 css 文件。
我确定我的 nginx 配置文件/etc/nginx/sites-available/default
可能是 fubar-ed,但我似乎无法弄清楚在哪里,因为错误或访问日志暴露了任何错误,OctoPi 上的 haproxy 日志也没有。
Nginx 配置文件:
server {
listen 80;
server_name www.example.com;
listen [::]:80 default_server;
return 301 https://example.com$request_uri;
}
server {
listen 443 ssl;
server_name www.example.com;
return 301 https://example.com$request_uri;
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
# managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # …
Run Code Online (Sandbox Code Playgroud)