我正在开展一个项目,我希望为每个用户提供唯一的URL.例如,
http://www.SocialNetwork.com/jhon , http://www.SocialNetwork.com/jasmine,
Run Code Online (Sandbox Code Playgroud)
到目前为止,我能够实现这一点: http://www.SocialNetwork.com/profiles/jasmine 这里的配置文件是我可以获取用户名的操作
<constant name="struts.mapper.alwaysSelectFullNamespace" value="false"/>
<constant name="struts.enable.SlashesInActionNames" value="true"/>
<constant name="struts.patternMatcher" value="namedVariable"/>
<action name="profiles/{username}" class="com.example.actions.ViewProfileAction">
<result name="input">/WEB-INF/jsp/profile.jsp</result>
</action>
Run Code Online (Sandbox Code Playgroud)
但我希望实现像这样的东西,http://www.SocialNetwork.com/jasmine
只需域名然后用户名.
像twitter一样:
www.twitter.com/username
怎么做到这一点?
我有一个ul是<ul>列表,我想获得不同的功能和所选择的值列表看起来象下面这样
<ul class="dropdown-menu" role="menu" id="ChooseAreaList">
<li><a href="#">Select Destination</a></li>
<li><a href="#">HSR</a></li>
<li><a href="#">Bommanahalli</a></li>
<li><a href="#">Kormangala</a></li>
</ul>
Run Code Online (Sandbox Code Playgroud)
通过应用一些CSS,JS我能够获得这样的列表的选定值......
$(".dropdown-menu li a").click(function(){
var selText = $(this).text();///User selected value...****
$(this).parents('.btn-group').find('.dropdown-toggle').html(selText+' <span class="caret"></span>');
});
Run Code Online (Sandbox Code Playgroud)
但是如果我试图在不同的函数中获得这个选定的值,它就不起作用......就像这样
function BusinessLogic(){
var selText = $('.dropdown-menu li a').text();
alert("Its displaying Entire List"+selText);
}
Run Code Online (Sandbox Code Playgroud)
如何在不同的函数中获取该列表的选定值?
我已尝试一切方法来读取以下 JSON 字符串,但仍然收到以下错误。
我的 JSON 字符串是有效的,我认为问题在于子元素的映射存在问题。
这是我的 JSON 字符串:
[
{
"denotations": [
{
"id": [
"CUI-less"
],
"obj": "disease",
"span": {
"begin": 31,
"end": 41
}
}
],
"elapsed_time": {
"ner": 2.759,
"normalization": 0.002,
"tmtool": 0.148,
"total": 2.91
},
"logits": {
"disease": [
[
{
"end": 41,
"id": "CUI-less",
"start": 31
},
0.999957799911499
]
],
"drug": [],
"gene": [],
"species": []
},
"project": "BERN",
"sourcedb": "PubMed",
"sourceid": "2832773",
"text": "Absence of humoral immunity to poliovirus in vaccinated individuals.",
"timestamp": …Run Code Online (Sandbox Code Playgroud) 我是线程概念的新手,我正在努力学习....
我遇到了一种情况,我有一个方法,它返回一个学生列表......以及其他方法,使用此列表来提取学生的其他详细信息,如ParentsName,他们参与的体育等(基于StudentID)..我尝试使用以下代码返回列表,似乎它不起作用:(
import java.util.ArrayList;
public class studentClass implements Runnable
{
private volatile List<Student> studentList;
@Override
public void run()
{
studentList = "Mysql Query which is returning StudentList(StudentID,StudentName etc)";
}
public List<Student> getStudentList()
{
return studentList;
}
}
public class mainClass
{
public static void main(String args[])
{
StudentClass b = new StudentClass();
new Thread(b).start();
// ...
List<Student> list = b.getStudentList();
for(StudentClass sc : b)
{
System.out.println(sc);
}
}
}
Run Code Online (Sandbox Code Playgroud)
我使用此链接 - 从Thread返回值
列表为NULL.
我哪里错了...... ???
在解析XML文件时,我的文档构建器正在寻找DTD,有时它会引发错误(服务器崩溃)。因此,当我用Google搜索时,从这里得到了以下解决方案,在解析XML时忽略了DTD(我使用的解决方案是VOTE --- 90)。我的IDE中的字母显示以下错误。
The method setFeature(String, boolean) is undefined for the type DocumentBuilderFactory
然后我认为这是我的Maven版本的问题,然后找到了以下链接。
它说它是内置在JDK中的,所以IDE本身会建议我导入。
我的JDK版本是
Java版本“ 1.8.0_121” Java™SE运行时环境(内部版本1.8.0_121-b13)Java HotSpot(TM)64位服务器VM(内部版本25.121-b13,混合模式)