小编Nih*_*rma的帖子

Tomcat在RUN模式下启动但在调试模式下它会永远挂起会有什么问题?

我正在使用STS(eclipse)并面临与Tomcat的奇怪问题.它运行良好,突然间它开始出现问题.首先它响应非常缓慢,并且在调试模式下它根本没有响应.虽然它在RUN模式下启动时运行正常,但在调试时它会等待一些事情 -

May 15, 2013 9:03:51 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
May 15, 2013 9:03:51 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.32
May 15, 2013 9:03:53 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Run Code Online (Sandbox Code Playgroud)

服务器永远停滞不前,似乎是要求某处左右的东西.我做了很多事情 - 删除服务器并重新设置整个东西,采用了不同的Tomcat.我确实没有改变任何设置.

eclipse spring tomcat

2
推荐指数
1
解决办法
1896
查看次数

如何获取Shopify商店中任何产品的URL,因为如果它属于集合,其模式会有所不同?

对于不属于任何集合的产品,我们可以将网址定义为 - <shop-url>/products/< product.handle >.如果产品属于集合,则更改为 - <shop-url>/collections/<collection-name>/products/< product.handle >.还有第三种情况吗?

如何处理这些案件.此外,当我拨打api电话时,我没有将产品名称附加到产品上,以便我可以自己构建网址.在通过api调用获取产品时,是否有通用的方法来获取产品URL?

我想知道为什么shopify不直接提供产品网址!有什么缘故吗?

编辑:

我刚刚意识到,即使产品与集合相关联,我们也可以将其网址作为 <shop-url>/products/< product.handle >; 并且<shop-url>/collections/<collection-name>/products/< product.handle >是一回事.两个不同的网址,但相同的页面?

ruby shopify

2
推荐指数
1
解决办法
1942
查看次数

我可以在JSP中的URL中传递List作为参数吗?

我必须将一个List从.jsp传递到我的servlet中,我想通过一个URL来完成它.我能做点什么吗 -

<a href="SellSelectedStockServlet?value=content" target="_self">
Run Code Online (Sandbox Code Playgroud)

其中'content'是List.我想在我的servlet中获取此列表的元素.

或者我只能通过"&"的分隔传递单个参数?

java jsp servlets

1
推荐指数
1
解决办法
1万
查看次数

检查链表是否为回文(递归)

我正在尝试使用下面的代码,但结果总是true;

public boolean isPallindrome(Link link, Link right) {
    if (right == null)
        return true;

    if (!isPallindrome(link, right.getNext())) {
        return false;
    }
    boolean isP1 = right.getData() == link.getData();
    link = link.getNext();
    return isP1;
}
Run Code Online (Sandbox Code Playgroud)

呼叫:-

System.out.println(link1.isPallindrome(link1.getFirst(), link1.getFirst()));
Run Code Online (Sandbox Code Playgroud)

我认为罪魁祸首是从哪里right检查返回null。这是一个可能会true一直回来的。有人可以建议如何解决这个问题。

java algorithm recursion linked-list data-structures

1
推荐指数
1
解决办法
7819
查看次数

如何优化查询以更快地运行?

用户表有

id, email, password, gender, dob 
Run Code Online (Sandbox Code Playgroud)

等性别默认为null.我有另一张桌子user_gender,有first_namegender.我的SQL查询获得来自用户User和选择性别User_Gender基础上first_name.用户表非常庞大,大约有300,000多行.我正在运行下面提到的查询,但这花费了太多时间.如何优化此查询? -

select 
   count(*) 
from user u 
left outer join user_gender ug on ug.name = 
  case when locate(' ', u.name) > 0 then
     substring(u.name, 1,locate(' ', u.name))
  else
     u.name 
  end 
where 
  ug.gender != 'mf' and u.gender is null
Run Code Online (Sandbox Code Playgroud)

mysql sql

0
推荐指数
1
解决办法
83
查看次数

为什么Sender不向RabbitMQ中的队列发送数据?

我已经实现了 RabbitMQ,但卡在一个地方,似乎我的发送者无法向队列发送任何数据。

我的制作人课程:

@Service
public class MessageSender {

@Autowired
private AmqpTemplate template;

public void send(String text) {
    template.convertAndSend(text);
 }
}
Run Code Online (Sandbox Code Playgroud)

我的 spring 配置文件如下所示:

<rabbit:connection-factory id="connectionFactory"
                           addresses="${connectionFactory.addresses}" channel-cache-size="${connectionFactory.channel-cache-size}"
                           virtual-host="${connectionFactory.vhost}" username="${connectionFactory.user}"
                           password="${connectionFactory.password}" />

<rabbit:template id="amqpTemplate" connection-factory="connectionFactory" queue="myQueue" exchange="myExchange" routing-key="dummyKey"/>

<rabbit:queue name="myQueue" />

<rabbit:direct-exchange name="myExchange">
    <rabbit:bindings>
        <rabbit:binding queue="myQueue" />
    </rabbit:bindings>
</rabbit:direct-exchange>

<rabbit:listener-container connection-factory="connectionFactory">
    <rabbit:listener ref="messageHandler" method="onMessage" queue-names="myQueue" />
</rabbit:listener-container>

<rabbit:admin connection-factory="connectionFactory" />

<bean id="messageHandler" class="com.tm.email.sender.spring.MessageHandler" />
Run Code Online (Sandbox Code Playgroud)

我无法找出问题所在。

下面提到的事情完美地运作。我可以轻松地将消息推送到队列,然后我的发送者类工作得很好。

public class Send {
private final static String QUEUE_NAME = "myQueue";
public static void main(String[] …
Run Code Online (Sandbox Code Playgroud)

rabbitmq spring-amqp

0
推荐指数
1
解决办法
2305
查看次数

how to access current user in django model manager

I am making a CRUD application, and I have the current piece of code in my view:

def dashboard(request):
    template = 'dashboard/index.html'
    form = CustomerForm()      
    if request.user.groups.filter(name__in=['West']).exists():
        customers = Customer.objects.filter(Q(department='630') | Q(department='635')).all()
    elif request.user.groups.filter(name__in=['North']).exists():
        customers = Customer.objects.filter(Q(department='610') | Q(department='615') | Q(department='620')).all()
    elif request.user.groups.filter(name__in=['East']).exists():
        customers = Customer.objects.filter(Q(department='660') | Q(department='655') | Q(department='650')).all()
    elif request.user.groups.filter(name__in=['South']).exists():
        customers = Customer.objects.filter(Q(department='640') | Q(department='645')).all()
    elif request.user.groups.filter(name__in=['North-West']).exists():
        customers = Customer.objects.filter(Q(department='625')).all()
    else:
        customers = Customer.objects.all()

    context = {
        "customers": customers,
        "form": form, 
        }

    return render(request, template, context)
Run Code Online (Sandbox Code Playgroud)

I have …

django django-models

0
推荐指数
1
解决办法
761
查看次数