我在下面的剃刀页面上有链接.
@Html.ActionLink("Create New Profile", "Create", "Profile", new { @class="toplink" })
Run Code Online (Sandbox Code Playgroud)
我看到下面的页面查看源
<a href="/admin/profile/create?length=7" class="toplink">Create New Profile</a>
Run Code Online (Sandbox Code Playgroud)
当我点击链接.URL如下所示.
http://localhost:54876/admin/profile/create?length=7
Run Code Online (Sandbox Code Playgroud)
我不想要?长度= 7.为什么这是自动生成的.
是否有任何简单/内置的方法可以为MVC3制作小写的URL.
我有代码可以做到这一点,但看起来很容易实现.
routes.MapRouteLowercase(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "index", id = UrlParameter.Optional } // Parameter defaults
);
public class LowercaseRoute : Route
{
public LowercaseRoute(string url, IRouteHandler routeHandler)
: base(url, routeHandler)
{
}
public LowercaseRoute(string url, RouteValueDictionary defaults, IRouteHandler routeHandler)
: base(url, defaults, routeHandler)
{
}
public LowercaseRoute(string url, RouteValueDictionary defaults, RouteValueDictionary constraints, IRouteHandler routeHandler)
: base(url, defaults, constraints, routeHandler)
{
}
public LowercaseRoute(string url, RouteValueDictionary defaults, RouteValueDictionary constraints, …Run Code Online (Sandbox Code Playgroud) 从http://www.trirand.com/blog/下载JQGrid js文件.它是免费的吗?
这是什么http://www.trirand.net/demoaspnetmvc.aspx?.我看到价格和许可证.
请有人澄清一下.
对不起,如果没有正确询问问题.图像在struts项目中显示得很好,但在JSF2项目中没有.所有的CSS和按钮都渲染得很好except image that has url in css.
文件夹结构
resources -> css -> bootstrap.min.css
resources -> img -> glyphicons-halflings.png
Run Code Online (Sandbox Code Playgroud)
bootstrap.min.css
background-image: url("../img/glyphicons-halflings.png");
Run Code Online (Sandbox Code Playgroud)
1 -
如果我使用的<h:outputStylesheet library="css" name="bootstrap.min.css"/>是背景图像,则生成的url http://localhost:8000/img/glyphicons-halflings.png因此图像无法加载.它应该是http://localhost:8000/resources/img/glyphicons-halflings.png
2 -如果我使用<link href="#{request.contextPath}/resources/css/bootstrap.min.css" rel="styleSheet" type="text/css"/>比
Firefox - > Firebug - > Net tab {资源添加多次}
http://localhost:8000/resources/resources/img/glyphicons-halflings.png
Run Code Online (Sandbox Code Playgroud)
不知道如何加载css中的图像并应用于类.
将EDIT图标显示为链接以单击下一页.
<h:outputLink value="edit.xhtml" >
<i class="icon-edit" ></i>
<f:param name="id" value="#{person.id}"/>
</h:outputLink>
Run Code Online (Sandbox Code Playgroud)

想澄清一些困惑.我有applicationContext.xml.
问题1: 1和2之间的区别是什么?它们是否与不同的方法相同?
问题2:
我在Spring论坛上询问了一些问题.他提到的有关汇集的内容如下
如果您需要/想要使用内部连接池来进行hibernate,我会建议它,并简单地配置一个支持连接池的数据源并将其注入到sessionfactory中.
hibernate的内部连接池=这是下面的数字2.对?
只需配置一个支持连接池的数据源并将其注入sessionfactorybean =这是下面的数字1.对?
1# -
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${jdbc.driverClassName}"/>
<property name="url" value="${jdbc.url}"/>
<property name="username" value="${jdbc.username}"/>
<property name="password" value="${jdbc.password}"/>
<property name="maxActive" value="100"/>
<property name="maxIdle" value="30"/>
<property name="maxWait" value="16000"/>
<property name="minIdle" value="0"/>
</bean>
<!-- Hibernate SessionFactory -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="annotatedClasses">
<list>
<value>com.mkyong.customer.model.Customer</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.format_sql">false</prop>
<prop key="hibernate.generate_statistics">true</prop>
</props>
</property>
</bean>
Run Code Online (Sandbox Code Playgroud)
2# -
池和连接信息位于hibernate.cfg.xml中
<bean …Run Code Online (Sandbox Code Playgroud) 我<s:set var="buttonText" value="getText('person.button.add')"/>在JSTL中使用buttonText变量来设置文本.
有人告诉我如何在JSF EL中实现这一目标吗?
这里问的问题是JSF形式的IF-ELSE条件.需要知道正确的方法,但被告知作为一个单独的问题.
编辑:
我已经在上面添加了一个链接以获取详细信息,但这里又是
我在struts2项目中使用JSTL
<s:if test="person==null || person.id==null || person.id==''">
<s:set var="buttonText" value="getText('person.button.add')"/>
</s:if>
<s:else>
<s:set var="buttonText" value="getText('person.button.edit')"/>
</s:else>
Run Code Online (Sandbox Code Playgroud)
我想在JSF2中使用相同的方法,但使用表达式语言.我在一个变量中保存值,buttonText并在某个地方访问它#{buttonText}.我需要解决方法如何编写变量EL并使用它.希望清楚.
我只需要解决<s:set var="buttonText" value="getText('person.button.add')"/>代码行.
谢谢
我一直在检查JRebel.根据他们的网站:
"JRebel是一个任何Java插件,通过将工作空间中的更改重新加载到正在运行的JVM中,加速基于JVM的开发(Java,Scala,Groovy),无需重新启动或重新部署,在编码时维护应用程序的状态".
这似乎与我们已经使用Eclipse,Netbeans和IntelliJ实现的相同:我们保存并立即部署我们的更改.JRebel会给我们带来哪些额外的好处?
有人可以向我解释一下吗?
我有3个领域:urlName,displayName和active.这是检查编辑记录.我想在这里做的是UrlName在Db中检查是唯一的,但同时,如果用户已经保存了Url但是已经更改DisplayName,Active那么记录应该更新.
任何人告诉我如何解决这个问题.
public bool NothingExceptUrlNameExists(string urlName, string displayName, bool active)
{
return (from p in _db.SubMenus
where p.UrlName == urlName && (p.DisplayName != displayName || p.DisplayName == displayName) && (p.Active != active || p.Active == active)
select p).Any();
}
Run Code Online (Sandbox Code Playgroud)
更新记录就像
TryUpdateModel(existingMenu);
_menu.Add();
Run Code Online (Sandbox Code Playgroud)
这就是我想要实现的目标
我应该在Query DisplayName和Active中添加其他2个值.假设已经在DB中"联系"UrlName.我正在从下拉列表中加载值,返回UrlName ="About",DisplayName ="About Us",Active = true.现在编辑记录.这是匹配的条件.
1 - UrlName ="关于",DisplayName ="关于测试",活动=真 - >这应该更新.
2 - UrlName ="关于",DisplayName ="关于我们",Active = false - >这应该更新.
3 - …
我想将JQGrid"正在加载..."消息更改为带有动画gif图像的内容.到处看都看不到办法.有人请.