Spring-Data-Solr如何提供身份验证数据(Spring-Data-Solr How to provide authentication data)
我如何为spring数据solr服务器提供身份验证数据? 这是我的配置
<solr:solr-server id="solrServer" url="http://xxxxxxxx:8983/solr" /> <bean id="solrTemplate" class="org.springframework.data.solr.core.SolrTemplate" scope="singleton"> <constructor-arg ref="solrServer" /> </bean> <bean id="searchRepository" class="com.bankofamerica.atmtech.repository.SolrJournalRepository"> <property name="solrOperations" ref="solrTemplate" /> </bean> <bean id="App" class="App"> <property name="repo" ref="searchRepository" /> </bean>
我没有看到任何可以设置它的属性。
how do i proivde authentication data for spring data solr server? Here is what i have in configuration
<solr:solr-server id="solrServer" url="http://xxxxxxxx:8983/solr" /> <bean id="solrTemplate" class="org.springframework.data.solr.core.SolrTemplate" scope="singleton"> <constructor-arg ref="solrServer" /> </bean> <bean id="searchRepository" class="com.bankofamerica.atmtech.repository.SolrJournalRepository"> <property name="solrOperations" ref="solrTemplate" /> </bean> <bean id="App" class="App"> <property name="repo" ref="searchRepository" /> </bean>
I don't see any property where i can set it.
原文:https://stackoverflow.com/questions/24540855
最满意答案
您必须在生成的html中更改href属性。
您可以通过创建href属性,将其拆分为数组,然后更改数组中的值并再次将其连接到带有分隔符的一个字符串,然后替换元素中的href属性来实现此目的。
代码示例:
var $link = $('#continue-link'); var href = $link.attr('href').split('/'); href[3] = 4; //here you set your new asp-route-id value $link.attr('href', href.join('/'));
检查此codepen以了解它是如何工作的。
You have to change your href attribute in generated html.
You can achive this by geting your href attribute, split it into array, then change value in array and join it again into one string with separator and then replace href attribute in your a element.
Code example:
var $link = $('#continue-link'); var href = $link.attr('href').split('/'); href[3] = 4; //here you set your new asp-route-id value $link.attr('href', href.join('/'));
Check this codepen to see how it work.
相关问答
更多-
这是一个微妙的问题,但却很重要。 问题是这行代码[HtmlTargetElement(Attributes = "email")] 如果您将其删除,则应使用
WHY 标记。 您也可以用[HtmlTargetElement("email")]替换它,但在这种情况下实际上甚至不需要它,因为框架可以从类EmailTagHelper的名称推断出该信息。 通过包含[HtmlTargetElement(Attributes = "email")]您说您希望通过任何标记上的属性调用标记帮助程序。 ... -
在ASP.NET MVC6中使用TagHelpers与ViewComponents(Using TagHelpers vs ViewComponents in ASP.NET MVC6)[2022-08-02]
TagHelpers和ViewComponents之间肯定存在一些概念上的重叠。 TagHelpers是您使用HTML的实用工具,其中ViewComponents是您坚持使用C#,独立工作,然后吐出HTML的方式。 我会详细介绍每个细节: ViewComponents 您的概念上等效的微型控制器; 您将看到许多ViewComponents公开的方法/属性对于Controller中存在的方法/属性非常熟悉。 现在至于调用ViewComponents,这更像是使用HTML助手(TagHelpers变得更好)。 ... -
ReSharper 9.2是否支持ASP.NET 5 TagHelpers的智能感知(Does ReSharper 9.2 support intellisense for ASP.NET 5 TagHelpers)[2022-06-26]
目前,TagHelpers计划为ReSharper 10提供支持。请参阅YouTrack问题RSRP-427939 。 At the moment TagHelpers support is planned for ReSharper 10. See YouTrack issue RSRP-427939. -
好吧,我知道了,原始表达式保存在 ModelExpression.Name Ok I got it, the original expression is saved in ModelExpression.Name
-
您必须在生成的html中更改href属性。 您可以通过创建href属性,将其拆分为数组,然后更改数组中的值并再次将其连接到带有分隔符的一个字符串,然后替换元素中的href属性来实现此目的。 代码示例: var $link = $('#continue-link'); var href = $link.attr('href').split('/'); href[3] = 4; //here you set your new asp-route-id value $link.attr('href', href. ...
-
遗憾的是,Visual Studio Code目前不支持TagHelper IntelliSense。 这是我们为未来而努力的事情! Sadly TagHelper IntelliSense is not currently supported in Visual Studio Code. It is something we're working on for the future though!
-
您需要的是客户端(网页)和服务器(asp.net核心MVC)之间的全双工通信。 使用经典的MVC Razor webapp,通信是半双工的; 它是从您的客户端到您的服务器的一种方式,不幸的是,从来没有相反。 能够实现您想要实现的目标的流行解决方案是: https://github.com/websockets/ws https://www.asp.net/signalr What you need is full duplex communication between your client (webpa ...
-
所以没有类似的东西,请查看我自己的库以支持旧版MVC中的标记 nuget https://www.nuget.org/packages/Xania.AspNet.TagHelpers/ codeproject http://www.codeproject.com/Tips/881721/TagHelpers-in-MVC-v-less-than-Next So there is nothing like it, check out my own library to support taghelpers i ...
-
你不能使用http(Ajax)调用视图组件,但是你可以让控制器上的action方法将视图组件作为resut返回 You can not call view components using http(Ajax) but you can have action method on controller will can return view component out put as resut
-
TagHelpers在移动到不同的项目后不会被调用(TagHelpers doesn't get invoked after moving them to a different project)[2023-11-04]
addTagHelper指令需要两个逗号分隔的参数。 文档有关于它如何工作的说法: @addTagHelper之后的第一个参数指定加载标签助手(我们对所有标签助手使用“*”),第二个参数“Microsoft.AspNetCore.Mvc.TagHelpers”指定包含标签助手的程序集 。 请注意我以粗体突出显示的内容:这不是需要的名称空间; 这是集会。 在您的示例中,您需要更改第二个参数以反映新的主机程序集: @addTagHelper *, LC.Tools.Utility The addTagHelp ...